X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=debian%2Finit.d;h=8f65c9a1312f6f304df811a8619d1c653e64f976;hb=6ab9830668191a9e6d93ee02953d484cc653cad6;hp=9fc1a8f3d765534d1d51f0905601f5b5d0fe49bf;hpb=72081f829de368392d04076728f8c991178c0080;p=privoxy.git diff --git a/debian/init.d b/debian/init.d index 9fc1a8f3..8f65c9a1 100644 --- a/debian/init.d +++ b/debian/init.d @@ -1,5 +1,19 @@ #! /bin/sh +### BEGIN INIT INFO +# Provides: privoxy +# Required-Start: $local_fs $remote_fs $network $time +# Required-Stop: $local_fs $remote_fs $network $time +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Privacy enhancing HTTP Proxy +# Description: Privoxy is a web proxy with advanced filtering +# capabilities for protecting privacy, filtering +# web page content, managing cookies, controlling +# access, and removing ads, banners, pop-ups and +# other obnoxious Internet junk. +### END INIT INFO + PATH=/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/sbin/privoxy NAME=privoxy @@ -20,6 +34,7 @@ case "$1" in 2>> /var/log/privoxy/errorfile echo "$NAME." ;; + stop) echo -n "Stopping $DESC: " start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \ @@ -27,24 +42,8 @@ case "$1" in rm -f $PIDFILE echo "$NAME." ;; - #reload) - # - # If the daemon can reload its config files on the fly - # for example by sending it SIGHUP, do it here. - # - # If the daemon responds to changes in its config file - # directly anyway, make this a do-nothing entry. - # - # echo "Reloading $DESC configuration files." - # start-stop-daemon --stop --signal 1 --quiet --pidfile \ - # /var/run/$NAME.pid --exec $DAEMON - #;; + restart|force-reload) - # - # If the "reload" option is implemented, move the "force-reload" - # option to the "reload" entry above. If not, "force-reload" is - # just the same as "restart". - # echo -n "Restarting $DESC: " start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \ --exec $DAEMON @@ -54,10 +53,25 @@ case "$1" in 2>> /var/log/privoxy/errorfile echo "$NAME." ;; + + status) + echo -n "Status of $DESC: " + if [ ! -r "$PIDFILE" ]; then + echo "$NAME is not running." + exit 3 + fi + if read pid < "$PIDFILE" && ps -p "$pid" > /dev/null 2>&1; then + echo "$NAME is running." + exit 0 + else + echo "$NAME is not running but $PIDFILE exists." + exit 1 + fi + ;; + *) N=/etc/init.d/$NAME - # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $N {start|stop|restart|force-reload}" >&2 + echo "Usage: $N {start|stop|restart|force-reload|status}" >&2 exit 1 ;; esac