1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

check winbind in monitoring event too

(This used to be ctdb commit bccba656c21d0edbd9840401a3c43a76b1b3bc05)
This commit is contained in:
Andrew Tridgell 2007-06-17 12:05:29 +10:00
parent d683080b08
commit 9d0a595594
2 changed files with 17 additions and 0 deletions

View File

@ -65,6 +65,9 @@ case $cmd in
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

View File

@ -162,3 +162,17 @@ ctdb_check_tcp_ports() {
}
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
}
}