From e66a1af9b33d6dfe925dacbe58b99cf068dd7ec4 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Fri, 27 May 2011 14:37:37 +1000 Subject: Eventscripts: 50.samba - only start/stop nmbd if $CTDB_SERVICE_NMB set. Signed-off-by: Martin Schwenke (This used to be ctdb commit defaec99df8c279d8e315d5010f9146e013afda2) --- ctdb/config/events.d/50.samba | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ctdb/config/events.d/50.samba b/ctdb/config/events.d/50.samba index 25e7f7596c..1c6822714f 100755 --- a/ctdb/config/events.d/50.samba +++ b/ctdb/config/events.d/50.samba @@ -39,7 +39,9 @@ service_start () if [ "$_service_name" = "samba" ] || \ is_ctdb_managed_service "samba" ; then service "$CTDB_SERVICE_SMB" stop > /dev/null 2>&1 - service "$CTDB_SERVICE_NMB" stop > /dev/null 2>&1 + if [ -n "$CTDB_SERVICE_NMB" ] ; then + service "$CTDB_SERVICE_NMB" stop > /dev/null 2>&1 + fi killall -0 -q smbd && { sleep 1 # make absolutely sure samba is dead @@ -81,10 +83,12 @@ service_start () is_ctdb_managed_service "samba" ; then net serverid wipe - nice_service "$CTDB_SERVICE_NMB" start || { + if [ -n "$CTDB_SERVICE_NMB" ] ; then + nice_service "$CTDB_SERVICE_NMB" start || { echo failed to start nmbd exit 1 - } + } + fi nice_service "$CTDB_SERVICE_SMB" start || { echo failed to start samba exit 1 @@ -101,7 +105,9 @@ service_stop () if [ "$_service_name" = "samba" ] || \ is_ctdb_managed_service "samba" ; then service "$CTDB_SERVICE_SMB" stop - service "$CTDB_SERVICE_NMB" stop + if [ -n "$CTDB_SERVICE_NMB" ] ; then + service "$CTDB_SERVICE_NMB" stop + fi fi # stop the winbind service -- cgit