Rev 545: check winbind in monitoring event too in
http://samba.org/~tridge/ctdb
tridge at samba.org
tridge at samba.org
Sun Jun 17 02:05:30 GMT 2007
------------------------------------------------------------
revno: 545
revision-id: tridge at samba.org-20070617020529-q032m8vir2vx3c2i
parent: tridge at samba.org-20070617015742-vstv17rrkkpahaij
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge
timestamp: Sun 2007-06-17 12:05:29 +1000
message:
check winbind in monitoring event too
modified:
config/events.d/50.samba samba-20070601105340-vlcvnp6euoj3zdwy-3
config/functions functions-20070601105405-gajwirydr5a9zd6x-1
=== modified file 'config/events.d/50.samba'
--- a/config/events.d/50.samba 2007-06-17 01:57:42 +0000
+++ b/config/events.d/50.samba 2007-06-17 02:05:29 +0000
@@ -65,6 +65,9 @@
smb_ports=`testparm -sv 2> /dev/null | egrep '\s*smb ports =' | cut -d= -f2`
ctdb_check_tcp_ports "Samba" $smb_ports
+
+ # check winbind is OK
+ ctdb_check_command "winbind" "wbinfo -p"
;;
esac
=== modified file 'config/functions'
--- a/config/functions 2007-06-17 01:57:42 +0000
+++ b/config/functions 2007-06-17 02:05:29 +0000
@@ -162,3 +162,17 @@
}
done
}
+
+######################################################
+# check a command returns zero status
+# usage: ctdb_check_command SERVICE_NAME <command>
+######################################################
+ctdb_check_command() {
+ service_name="$1"
+ wait_cmd="$2"
+ [ -z "$wait_cmd" ] && return;
+ $wait_cmd > /dev/null 2>&1 || {
+ echo "`date` ERROR: $service_name - $wait_cmd returned error"
+ exit 1
+ }
+}
More information about the samba-cvs
mailing list