6
# Required-Start: $remote_fs
7
# Required-Stop: $remote_fs
8
# Default-Start: 2 3 4 5
10
# Short-Description: apt-cacher package caching proxy daemon
11
# Description: The apt-cacher service is used to cache packages for a system or LAN
14
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
17
DAEMON=/usr/sbin/$NAME
18
PIDFILE=/var/run/$NAME/$NAME.pid
19
SCRIPTNAME=/etc/init.d/$NAME
21
# Gracefully exit if the package has been removed.
22
test -x $DAEMON || exit 0
24
# Read config file if it is present.
25
if [ -r /etc/default/$NAME ]
30
. /lib/lsb/init-functions
33
# Function that starts the daemon/service.
37
if test "$AUTOSTART" = 1 ; then
38
start-stop-daemon --start --quiet \
39
--exec $DAEMON -- -R 3 -d -p $PIDFILE $EXTRAOPT && \
42
echo "Not started (AUTOSTART not enabled in /etc/default/$NAME)";
47
# Function that stops the daemon/service.
50
start-stop-daemon --stop --quiet --retry=TERM/10/KILL/5 --pidfile $PIDFILE \
53
# Also stop any running libcurl backend
54
/usr/share/apt-cacher/libcurl.pl EXIT
59
echo -n "Starting $DESC: "
63
echo -n "Stopping $DESC: "
68
echo -n "Restarting $DESC: "
74
echo -n "Reloading configuration of $DESC: "
75
test -f $PIDFILE && pid=`cat $PIDFILE`
76
if test -z "$pid" ; then
77
echo "$NAME not running."
79
kill -HUP $pid && echo "done!."
83
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
86
echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2