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"
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
#
# 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
}
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)
#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
*)
#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