]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
handler: show unit logs on error
authorSébastien Han <seb@redhat.com>
Tue, 27 Nov 2018 09:45:05 +0000 (10:45 +0100)
committermergify[bot] <mergify[bot]@users.noreply.github.com>
Tue, 27 Nov 2018 11:00:37 +0000 (11:00 +0000)
This will tremendously help debugging daemons that fail on restart by
showing the systemd unit logs.

Signed-off-by: Sébastien Han <seb@redhat.com>
roles/ceph-handler/templates/restart_mds_daemon.sh.j2
roles/ceph-handler/templates/restart_mgr_daemon.sh.j2
roles/ceph-handler/templates/restart_mon_daemon.sh.j2
roles/ceph-handler/templates/restart_nfs_daemon.sh.j2
roles/ceph-handler/templates/restart_osd_daemon.sh.j2
roles/ceph-handler/templates/restart_rbd_mirror_daemon.sh.j2
roles/ceph-handler/templates/restart_rgw_daemon.sh.j2

index db817e6d8235e099f78c64e990a8ba03670f2e33..2300386e0edb904ad7d0880f29199ae28d445ab5 100644 (file)
@@ -21,5 +21,6 @@ while [ $RETRIES -ne 0 ]; do
   let RETRIES=RETRIES-1
 done
 # If we reach this point, it means the socket is not present.
-echo "Socket file ${SOCKET} could not be found, which means the Metadata Server is not running."
+echo "Socket file ${SOCKET} could not be found, which means the Metadata Server is not running. Showing ceph-mds unit logs now:"
+journalctl -u ceph-mds@${MDS_NAME}
 exit 1
index d9dc72801d790ddd01e5e0ebef76c8090131b136..a9bbc9f966c738dadd073f99dfbfa398478c3889 100644 (file)
@@ -22,5 +22,6 @@ while [ $RETRIES -ne 0 ]; do
   let RETRIES=RETRIES-1
 done
 # If we reach this point, it means the socket is not present.
-echo "Socket file ${SOCKET} could not be found, which means ceph manager is not running."
+echo "Socket file ${SOCKET} could not be found, which means ceph manager is not running. Showing ceph-mgr unit logs now:"
+journalctl -u ceph-mgr@${MGR_NAME}
 exit 1
index 748b0737473140a58ff01036e4d241cf8ba93b60..0e8318c46007cd767b1ab379f526e6ac779837d2 100644 (file)
@@ -38,5 +38,6 @@ while [ $COUNT -ne 0 ]; do
   let COUNT=COUNT-1
 done
 # If we reach this point, it means the socket is not present.
-echo "Socket file ${SOCKET} could not be found, which means the monitor is not running."
+echo "Socket file ${SOCKET} could not be found, which means the monitor is not running. Showing ceph-mon unit logs now:"
+journalctl -u ceph-mon@{{ ansible_hostname }}
 exit 1
index 628b05fe4b4eb2ffe6bd7001df55b94c45562c7a..6567ed3a9c0b0ba3e58448c475b07b7a2e12a6a5 100644 (file)
@@ -18,7 +18,8 @@ while [ $RETRIES -ne 0 ]; do
   let RETRIES=RETRIES-1
 done
 # If we reach this point, it means the pid is not present.
-echo "PID file ${PID} could not be found, which means Ganesha is not running."
+echo "PID file ${PID} could not be found, which means Ganesha is not running. Showing $NFS_NAME unit logs now:"
+journalctl -u $NFS_NAME
 exit 1
 {% else %}
 systemctl restart nfs-ganesha
index 09de06d5cf13106c9d06c1dd707cd0440c82aca9..7559271c587b493c8ccaa008e5e1af7629dc2c7f 100644 (file)
@@ -87,6 +87,7 @@ for unit in $(systemctl list-units | grep -E "loaded * active" | grep -oE "ceph-
     let COUNT=COUNT-1
   done
   # If we reach this point, it means the socket is not present.
-  echo "Socket file ${SOCKET} could not be found, which means the osd daemon is not running."
+  echo "Socket file ${SOCKET} could not be found, which means the osd daemon is not running. Showing ceph-osd unit logs now:"
+  journalctl -u "${unit}"
   exit 1
 done
index 52113b6606dd5b8637564a3a5fc9f6602f1a4f9c..bb6b58da96b7e323658c8a8ccb3fef5eb9479f7b 100644 (file)
@@ -21,5 +21,6 @@ while [ $RETRIES -ne 0 ]; do
   let RETRIES=RETRIES-1
 done
 # If we reach this point, it means the socket is not present.
-echo "Socket file ${SOCKET} could not be found, which means rbd mirror is not running."
+echo "Socket file ${SOCKET} could not be found, which means rbd mirror is not running. Showing ceph-rbd-mirror unit logs now:"
+journalctl -u ceph-rbd-mirror@rbd-mirror.${RBD_MIRROR_NAME}
 exit 1
index cfb43d1195398db365c8d9fb3c049734c237a73b..976b6cc3b81c7573760b5fe26abedfc88dc1ab21 100644 (file)
@@ -46,5 +46,6 @@ while [ $COUNT -ne 0 ]; do
   sleep $DELAY
   let COUNT=COUNT-1
 done
-echo "Socket file ${SOCKET} could not be found, which means Rados Gateway is not running."
+echo "Socket file ${SOCKET} could not be found, which means Rados Gateway is not running. Showing ceph-rgw unit logs now:"
+journalctl -u ceph-radosgw@rgw.${RGW_NAME}
 exit 1