* Command is now multiple arguments, preserving quoting
* $service_name no longer printed, no longer an argument
* Debug output from failed command
Signed-off-by: Martin Schwenke <martin@meltin.net>
;;
monitor)
- ctdb_check_command "winbind" "wbinfo -p"
+ ctdb_check_command wbinfo -p
;;
takeip|releaseip)
######################################################
# check a command returns zero status
-# usage: ctdb_check_command SERVICE_NAME <command>
+# usage: ctdb_check_command <command>
######################################################
-ctdb_check_command() {
- service_name="$1"
- wait_cmd="$2"
- [ -z "$wait_cmd" ] && return;
- $wait_cmd > /dev/null 2>&1 || {
- echo "ERROR: $service_name - $wait_cmd returned error"
- exit 1
- }
+ctdb_check_command ()
+{
+ _out=$("$@" 2>&1) || {
+ echo "ERROR: $* returned error"
+ echo "$_out" | debug
+ exit 1
+ }
}
################################################
setup_winbind
wbinfo_down
-required_result 1 "ERROR: winbind - wbinfo -p returned error"
+required_result 1 "ERROR: wbinfo -p returned error"
simple_test