diff options
| author | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2010-11-18 15:40:19 +1100 |
|---|---|---|
| committer | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2010-11-22 20:42:26 +1100 |
| commit | ebcc866ae022dc7eee821571fdf88edae8d9c3fe (patch) | |
| tree | 34bc9cbc766422d47b72aef7371a9ddbe25b5539 | |
| parent | a3e7dfadcafe63b1bbd35ff0b7c096425c77f95b (diff) | |
| download | samba-ebcc866ae022dc7eee821571fdf88edae8d9c3fe.tar.gz samba-ebcc866ae022dc7eee821571fdf88edae8d9c3fe.tar.xz samba-ebcc866ae022dc7eee821571fdf88edae8d9c3fe.zip | |
update autostart/stop to work for samba
(This used to be ctdb commit 37ab57e2adaecc3f7996ea20af45a5df0cd8be76)
| -rwxr-xr-x | ctdb/config/events.d/50.samba | 5 | ||||
| -rwxr-xr-x | ctdb/config/functions | 9 |
2 files changed, 8 insertions, 6 deletions
diff --git a/ctdb/config/events.d/50.samba b/ctdb/config/events.d/50.samba index 5338c927e0..54a29cf00d 100755 --- a/ctdb/config/events.d/50.samba +++ b/ctdb/config/events.d/50.samba @@ -77,6 +77,7 @@ start_samba() { nice_service "$CTDB_SERVICE_NMB" start nice_service "$CTDB_SERVICE_SMB" start } + return 0 } stop_samba() { @@ -91,6 +92,8 @@ stop_samba() { [ "$CTDB_MANAGES_WINBIND" = "yes" ] && { service "$CTDB_SERVICE_WINBIND" stop } + + return 0 } # set default samba cleanup period - in minutes @@ -204,7 +207,7 @@ periodic_cleanup() { ########################### ctdb_start_stop_service -ctdb_start_stop_service "windbind" +ctdb_start_stop_service "winbind" is_ctdb_managed_service || is_ctdb_managed_service "winbind" || exit 0 diff --git a/ctdb/config/functions b/ctdb/config/functions index 5dd31fe09a..ee382257b1 100755 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -669,7 +669,7 @@ is_ctdb_managed_service () ctdb_compat_managed_service "$CTDB_MANAGES_VSFTPD" "vsftpd" ctdb_compat_managed_service "$CTDB_MANAGES_SAMBA" "samba" ctdb_compat_managed_service "$CTDB_MANAGES_SCP" "scp" - ctdb_compat_managed_service "$CTDB_MANAGES_WINDBIND" "windbind" + ctdb_compat_managed_service "$CTDB_MANAGES_WINBIND" "winbind" ctdb_compat_managed_service "$CTDB_MANAGES_HTTPD" "httpd" ctdb_compat_managed_service "$CTDB_MANAGES_ISCSI" "iscsi" ctdb_compat_managed_service "$CTDB_MANAGES_CLAMD" "clamd" @@ -684,8 +684,7 @@ ctdb_start_stop_service () _service_name="${1:-${service_name}}" _active="$ctdb_active_dir/$_service_name" - - if is_ctdb_managed_service ; then + if is_ctdb_managed_service "$_service_name"; then if ! [ -e "$_active" ] ; then echo "Starting service $_service_name" ctdb_service_start || exit $? @@ -693,13 +692,13 @@ ctdb_start_stop_service () touch "$_active" exit 0 fi - elif ! is_ctdb_managed_service ; then + else if [ -e "$_active" ] ; then echo "Stopping service $_service_name" ctdb_service_stop || exit $? rm -f "$_active" + exit 0 fi - exit 0 fi } |
