diff options
author | Martin Schwenke <martin@meltin.net> | 2011-05-27 14:37:37 +1000 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2011-08-11 10:46:57 +1000 |
commit | e66a1af9b33d6dfe925dacbe58b99cf068dd7ec4 (patch) | |
tree | bf2e2d5b9bd57a4c1c8a7d9b532d4c84ec566e43 | |
parent | 8fb04d451e526547376c5645e08072ad8caf6727 (diff) | |
download | samba-e66a1af9b33d6dfe925dacbe58b99cf068dd7ec4.tar.gz samba-e66a1af9b33d6dfe925dacbe58b99cf068dd7ec4.tar.xz samba-e66a1af9b33d6dfe925dacbe58b99cf068dd7ec4.zip |
Eventscripts: 50.samba - only start/stop nmbd if $CTDB_SERVICE_NMB set.
Signed-off-by: Martin Schwenke <martin@meltin.net>
(This used to be ctdb commit defaec99df8c279d8e315d5010f9146e013afda2)
-rwxr-xr-x | ctdb/config/events.d/50.samba | 14 |
1 files 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 |