samba-cvs.cvs
[Top] [All Lists]

Rev 545: check winbind in monitoring event too in http://samba.org/~trid

Subject: Rev 545: check winbind in monitoring event too in http://samba.org/~tridge/ctdb
From:
Date: Sun, 17 Jun 2007 12:05:30 +1000
------------------------------------------------------------
revno: 545
revision-id: tridge@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
parent: tridge@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
committer: Andrew Tridgell <tridge@xxxxxxxxx>
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
+  }
+}

<Prev in Thread] Current Thread [Next in Thread>
  • Rev 545: check winbind in monitoring event too in http://samba.org/~tridge/ctdb, tridge <=