X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=debian%2Finit.d;h=d089d7394522353f858a31a3cd237a1c0594f433;hp=4e96a1a6fd921d19109f2903ac433863b5b22c2d;hb=ebdff638af74b74396a918cc77bb1c2bc13becff;hpb=4715e1ff4ca0655d4e06996ac22693b442facf66 diff --git a/debian/init.d b/debian/init.d index 4e96a1a6..d089d739 100644 --- a/debian/init.d +++ b/debian/init.d @@ -1,8 +1,8 @@ #! /bin/sh ### BEGIN INIT INFO # Provides: privoxy -# Required-Start: $local_fs $remote_fs $network $time -# Required-Stop: $local_fs $remote_fs $network $time +# Required-Start: $local_fs $remote_fs $named $network $time +# Required-Stop: $local_fs $remote_fs $named $network $time # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Privacy enhancing HTTP Proxy @@ -22,7 +22,7 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="filtering proxy server" NAME=privoxy DAEMON=/usr/sbin/$NAME -PIDFILE=/var/run/$NAME.pid +PIDFILE=/run/$NAME.pid OWNER=privoxy CONFIGFILE=/etc/privoxy/config DAEMON_ARGS="--pidfile $PIDFILE --user $OWNER $CONFIGFILE" @@ -42,9 +42,6 @@ if [ ! -d "$LOGDIR" ]; then chown $OWNER:adm $LOGDIR fi -# Load the VERBOSE setting and other rcS variables -. /lib/init/vars.sh - # Define LSB log_* functions. # Depend on lsb-base (>= 3.0-6) to ensure that this file is present. . /lib/lsb/init-functions @@ -97,13 +94,13 @@ do_stop() # # Function that sends a SIGHUP to the daemon/service # -do_reload() { +do_rotate() { # # If the daemon can reload its configuration without # restarting (for example, when it is sent a SIGHUP), # then implement that here. # - start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME + start-stop-daemon --stop --signal HUP --quiet --pidfile $PIDFILE --name $NAME return 0 } @@ -111,23 +108,23 @@ do_reload() { case "$1" in start) if [ "$RUN_DAEMON" = "no" ]; then - [ "$VERBOSE" != no ] && log_warning_msg "Not starting $DESC (disabled in $DEFAULTSFILE)." + log_warning_msg "Not starting $DESC (disabled in $DEFAULTSFILE)." exit 0 fi - [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME" + log_daemon_msg "Starting $DESC" "$NAME" do_start case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + 0|1) log_end_msg 0 ;; + 2) log_end_msg 1 ;; esac ;; stop) - [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME" + log_daemon_msg "Stopping $DESC" "$NAME" do_stop case "$?" in - 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;; - 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;; + 0|1) log_end_msg 0 ;; + 2) log_end_msg 1 ;; esac ;; #reload|force-reload) @@ -139,13 +136,18 @@ case "$1" in #do_reload #log_end_msg $? #;; + rotate) + log_daemon_msg "Closing open files" "$NAME" + do_rotate + log_end_msg $? + ;; restart|force-reload) # # If the "reload" option is implemented then remove the # 'force-reload' alias # if [ "$RUN_DAEMON" = "no" ]; then - [ "$VERBOSE" != no ] && log_warning_msg "Not restarting $DESC (disabled in $DEFAULTSFILE)." + log_warning_msg "Not restarting $DESC (disabled in $DEFAULTSFILE)." exit 0 fi @@ -173,7 +175,7 @@ case "$1" in *) #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 - echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2 + echo "Usage: $SCRIPTNAME {start|stop|rotate|restart|force-reload|status}" >&2 exit 3 ;; esac