diff options
author | Jeremy Hinegardner <jeremy@hinegardner.org> | 2008-03-30 16:59:11 -0700 |
---|---|---|
committer | Mukund Sivaraman <muks@banu.com> | 2008-03-30 16:59:11 -0700 |
commit | 14edbda9f0397a4981181eec0cbf4f192fa2d295 (patch) | |
tree | 08341d27c027c0ded6e5455af9032ebdc390f07f /packaging/fedora/tinyproxy.init | |
parent | e229b360839fbfa3935707ba2c84f8041cf106c0 (diff) | |
download | tinyproxy-14edbda9f0397a4981181eec0cbf4f192fa2d295.tar.gz tinyproxy-14edbda9f0397a4981181eec0cbf4f192fa2d295.zip |
Added Fedora packaging files
Diffstat (limited to 'packaging/fedora/tinyproxy.init')
-rw-r--r-- | packaging/fedora/tinyproxy.init | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/packaging/fedora/tinyproxy.init b/packaging/fedora/tinyproxy.init new file mode 100644 index 0000000..dabe50f --- /dev/null +++ b/packaging/fedora/tinyproxy.init @@ -0,0 +1,89 @@ +#!/bin/sh +# +# tinyproxy +# +# chkconfig: - 85 15 +# description: small, efficient HTTP/SSL proxy daemon +# processname: tinyproxy +# config: /etc/tinyproxy/tinyproxy.conf +# 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 + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source networking configuration. +. /etc/sysconfig/network + +# Check that networking is up. +[ "$NETWORKING" = "no" ] && exit 0 + +exec="/usr/sbin/tinyproxy" +prog=$(basename $exec) + +[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog + +lockfile=/var/lock/subsys/tinyproxy + +start() { + echo -n $"Starting $prog: " + daemon $exec + retval=$? + echo + [ $retval -eq 0 ] && touch $lockfile + return $retval +} + +stop() { + echo -n $"Stopping $prog: " + # stop it here, often "killproc $prog" + killproc $prog + retval=$? + echo + [ $retval -eq 0 ] && rm -f $lockfile + return $retval +} + +restart() { + stop + start +} + +case "$1" in + start|stop|restart|reload) + $1 + ;; + force-reload) + restart + ;; + status) + status $prog + ;; + 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 + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}" + exit 2 + ;; +esac |