From ff434ea465b6579b82dc8dd9611dfe67daa624bb Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Tue, 14 Oct 2008 21:08:04 +0000 Subject: [PATCH] - added try-restart Changed files: smb.init -> 1.22 --- smb.init | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/smb.init b/smb.init index 00246a8..5b906c0 100644 --- a/smb.init +++ b/smb.init @@ -66,27 +66,32 @@ stop() { fi } +condrestart() { + if [ -f /var/lock/subsys/smb ]; then + stop + start + else + msg_not_running smb + RETVAL=$1 + fi +} + RETVAL=0 # See how we were called. case "$1" in start) - start + start ;; stop) - stop - ;; - status) - status smbd - RETVAL=$? - status nmbd - RET=$? - [ $RETVAL -eq 0 ] && RETVAL=$RET - smbstatus + stop ;; restart) stop start ;; + try-restart) + condrestart 0 + ;; reload|force-reload) if [ -f /var/lock/subsys/smb ]; then msg_reloading smb @@ -97,8 +102,16 @@ case "$1" in exit 7 fi ;; + status) + status smbd + RETVAL=$? + status nmbd + RET=$? + [ $RETVAL -eq 0 ] && RETVAL=$RET + smbstatus + ;; *) - msg_usage "$0 {start|stop|restart|reload|force-reload|status}" + msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}" exit 3 esac -- 2.44.0