5
# Required-Start: $remote_fs $syslog $time $network
6
# Required-Stop: $remote_fs $syslog $time $network
7
# Default-Start: 2 3 4 5
9
# Short-Description: Authenticating HTTP accelerator for NTLM secured proxies
10
# Description: Cntlm is meant to be given your proxy address and becomming
11
# the primary proxy then, listening on a selected local port.
12
# You point all your proxy-aware programs to it and don't ever
13
# have to deal with proxy authentication again.
16
# DAEMON Location of the binary
17
# PIDFILE Make sure that you or, if used, -U uid can create/write it
18
# TIMEOUT How long to wait for active connections to finish before
19
# forcing cntlm to stop with a second signal
20
# RUNAS Name or number of the non-privileged account to run as
23
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
24
DAEMON=/usr/sbin/cntlm
26
DESC="CNTLM Authentication Proxy"
29
PIDFILE=/var/run/cntlm/cntlm.pid
33
test -x $DAEMON || exit 0
35
. /lib/lsb/init-functions
36
test -r /etc/default/rcS && . /etc/default/rcS
38
# Include custom values if available
39
if [ -f /etc/default/cntlm ] ; then
43
DAEMON_OPTS="$DAEMON_OPTS -U $RUNAS -P $PIDFILE"
44
PIDDIR=`dirname $PIDFILE 2>/dev/null`
47
echo -n "Starting $DESC: "
49
if [ -n "$PIDDIR" -a ! -d "$PIDDIR" ]; then
50
mkdir -p "$PIDDIR" 2>/dev/null
51
chown "$RUNAS" "$PIDDIR" 2>/dev/null
52
chmod 755 "$PIDDIR" 2>/dev/null
55
start-stop-daemon --oknodo --quiet --start --pidfile $PIDFILE --name $NAME --startas $DAEMON -- $DAEMON_OPTS 2>/dev/null
64
echo -n "Stopping $DESC: "
65
start-stop-daemon --oknodo --quiet --stop --retry -HUP/$TIMEOUT/-HUP/2/forever/-KILL --pidfile $PIDFILE --name $NAME
80
restart|reload|force-reload)
85
status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $?
88
echo "Usage: $0 {start|stop|restart|reload|force-reload|status}" >&2