diff options
author | Jeremy Hinegardner <jeremy@hinegardner.org> | 2008-05-01 19:47:58 +0530 |
---|---|---|
committer | Mukund Sivaraman <muks@banu.com> | 2008-05-01 19:47:58 +0530 |
commit | fa7ecaca6d1b36c5315d0974e305d31a0d5d51ed (patch) | |
tree | 01b21d92a9ac46df082aed5bcd0aef9e552739d0 /packaging/fedora/tinyproxy.init | |
parent | b110332ed3ba89bb4d4c9e9864b9765d2e6e0431 (diff) | |
download | tinyproxy-fa7ecaca6d1b36c5315d0974e305d31a0d5d51ed.tar.gz tinyproxy-fa7ecaca6d1b36c5315d0974e305d31a0d5d51ed.zip |
Sync Fedora initscript and specfile
Diffstat (limited to '')
-rw-r--r-- | packaging/fedora/tinyproxy.init | 79 |
1 files changed, 48 insertions, 31 deletions
diff --git a/packaging/fedora/tinyproxy.init b/packaging/fedora/tinyproxy.init index dabe50f..9209674 100644 --- a/packaging/fedora/tinyproxy.init +++ b/packaging/fedora/tinyproxy.init @@ -1,25 +1,17 @@ #!/bin/sh # -# tinyproxy +# tinyproxy Startup script for the tinyproxy server # # chkconfig: - 85 15 # description: small, efficient HTTP/SSL proxy daemon +# # processname: tinyproxy # config: /etc/tinyproxy/tinyproxy.conf +# config: /etc/sysconfig/tinyproxy # pidfile: /var/run/tinyproxy.pid - -# http://fedoraproject.org/wiki/FCNewInit/Initscripts -### BEGIN INIT INFO -# Provides: -# Required-Start: -# Required-Stop: -# Should-Start: -# Should-Stop: -# Default-Start: -# Default-Stop: -# Short-Description: -# Description: -### END INIT INFO +# +# Note: pidfile is created by tinyproxy in its config +# see PidFile in the configuration file. # Source function library. . /etc/rc.d/init.d/functions @@ -32,14 +24,17 @@ exec="/usr/sbin/tinyproxy" prog=$(basename $exec) +config="/etc/tinyproxy/tinyproxy.conf" -[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog +[ -e /etc/sysconfig/tinyproxy ] && . /etc/sysconfig/tinyproxy lockfile=/var/lock/subsys/tinyproxy start() { + [ -x $exec ] || exit 5 + [ -f $config ] || exit 6 echo -n $"Starting $prog: " - daemon $exec + daemon $exec -c $config retval=$? echo [ $retval -eq 0 ] && touch $lockfile @@ -61,29 +56,51 @@ restart() { start } +reload() { + restart +} + +force_reload() { + restart +} + +rh_status() { + status $prog +} + +rh_status_q() { + rh_status >/dev/null 2>&1 +} + case "$1" in - start|stop|restart|reload) + start) + rh_status_q && exit 0 + $1 + ;; + stop) + rh_status_q || exit 0 + $1 + ;; + restart) + $1 + ;; + reload) + rh_status_q || exit 7 $1 ;; force-reload) - restart + force_reload ;; status) - status $prog + rh_status ;; - try-restart|condrestart) - if status $prog >/dev/null ; then - restart - fi - ;; - reload) - # If config can be reloaded without restarting, implement it here, - # remove the "exit", and add "reload" to the usage message below. - action $"Service $prog does not support the reload action: " /bin/false - exit 3 + condrestart|try-restart) + rh_status_q || exit 0 + restart ;; *) - echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}" + echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload}" exit 2 - ;; esac +exit $? + |