From c8d26d7c92096b3ca0a306dc2360906273f1ed04 Mon Sep 17 00:00:00 2001 From: Jakub Bogusz Date: Sun, 2 Dec 2007 11:18:09 +0000 Subject: [PATCH] - added try-restart action (LSB 3.1) Changed files: git-core.init -> 1.2 --- git-core.init | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/git-core.init b/git-core.init index dd3c1f3..cfd6594 100644 --- a/git-core.init +++ b/git-core.init @@ -63,6 +63,16 @@ reload() { fi } +condrestart() { + if [ -f /var/lock/subsys/git-daemon ]; then + stop + start + else + msg_not_running git-daemon + RETVAL=$1 + fi +} + RETVAL=0 # See how we were called. case "$1" in @@ -76,20 +86,18 @@ case "$1" in stop start ;; - reload) - reload + try-restart) + condrestart 0 ;; -# ONLY if program allows reloading without stopping -# otherwise include force-reload with 'reload' - force-reload) - reload + reload|force-reload) + reload ;; status) status git-daemon RETVAL=$? ;; *) - 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