From: Elan Ruusamäe Date: Sat, 22 Jan 2011 21:09:41 +0000 (+0000) Subject: - add try-restart, force-reload X-Git-Tag: auto/th/mythtv-0_23_1-3~2 X-Git-Url: http://git.pld-linux.org/?a=commitdiff_plain;h=1b6822bda40247edac2b534691b4ec64d7f07106;p=packages%2Fmythtv.git - add try-restart, force-reload Changed files: mythbackend.init -> 1.8 --- diff --git a/mythbackend.init b/mythbackend.init index f4f5211..d19d75b 100644 --- a/mythbackend.init +++ b/mythbackend.init @@ -48,6 +48,17 @@ stop() { rm -f /var/lock/subsys/mythbackend $pidfile >/dev/null 2>&1 } +condrestart() { + if [ ! -f /var/lock/subsys/mythbackend ]; then + msg_not_running "Mythbackend" + RETVAL=$1 + return + fi + + stop + start +} + flush-logs() { if [ ! -f /var/lock/subsys/mythbackend ]; then return @@ -70,6 +81,12 @@ case "$1" in stop start ;; + try-restart) + condrestart 0 + ;; + force-reload) + condrestart 7 + ;; flush-logs) flush-logs ;; @@ -77,7 +94,7 @@ case "$1" in status --pidfile $pidfile mythbackend ;; *) - msg_usage "$0 {start|stop|restart|reload|force-reload|status}" + msg_usage "$0 {start|stop|restart|try-restart|force-reload|flush-logs|status}" exit 3 esac