ctdb/events: use 'service "$CTDB_SERVICE_NMB" status' in 48.netbios.script
authorStefan Metzmacher <metze@samba.org>
Fri, 2 Feb 2024 12:54:20 +0000 (13:54 +0100)
committerGünther Deschner <gd@samba.org>
Tue, 13 Feb 2024 20:02:31 +0000 (20:02 +0000)
We can easily monitor if the service is running at all,
that better than no monitoring at all...

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15577

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
ctdb/config/events/legacy/48.netbios.script

index 43204476d6b258800c227c34b0faff95568e6ce0..1531e4919dee48a1364ef2a65e0f64dca5474751 100755 (executable)
@@ -48,6 +48,13 @@ service_stop ()
     service "$CTDB_SERVICE_NMB" stop
 }
 
+service_status ()
+{
+    service "$CTDB_SERVICE_NMB" status > /dev/null
+    test $? = 0 && return 0
+    service "$CTDB_SERVICE_NMB" status
+}
+
 ###########################
 
 case "$1" in
@@ -59,6 +66,10 @@ shutdown)
        service_stop
        ;;
 
+monitor)
+       service_status
+       ;;
+
 esac
 
 exit 0