4 ## THIS FILE IS UNDER PUPPET CONTROL. DON'T EDIT IT HERE.
5 ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
10 # Required-Start: $local_fs $remote_fs
11 # Required-Stop: $local_fs $remote_fs
12 # Should-Start: $syslog
13 # Should-Stop: $syslog
14 # Default-Start: 2 3 4 5
16 # Short-Description: Start or stop stunnel 4.x (SSL tunnel for network daemons)
19 DEFAULTPIDFILE="/var/run/stunnel4.pid"
20 DAEMON=/usr/bin/stunnel4
26 FILES="/etc/stunnel/*.conf"
27 if [ -n "${2-:}" ] && [ -e "/etc/stunnel/$2.conf" ]; then
28 FILES="/etc/stunnel/$2.conf}"
33 if test -f $file; then
34 CHROOT=`grep "^chroot" $file|sed "s;.*= *;;"`
35 PIDFILE=`grep "^pid" $file|sed "s;.*= *;;"`
36 if [ "$PIDFILE" = "" ]; then
37 PIDFILE=$DEFAULTPIDFILE
39 if test -f $CHROOT/$PIDFILE; then
46 if ! [ -d /var/run/stunnel4 ]; then
47 rm -rf /var/run/stunnel4
48 install -d -o stunnel4 -g stunnel4 /var/run/stunnel4
50 for file in $FILES; do
51 if test -f $file; then
53 PROCLIST=`get_pids $file`
54 if [ "$PROCLIST" ] && kill -0 $PROCLIST 2>/dev/null; then
55 echo -n "[Already running: $file] "
56 elif $DAEMON $ARGS; then
57 echo -n "[Started: $file] "
59 echo "[Failed: $file]"
60 echo "You should check that you have specified the pid= in you configuration file"
69 for file in $FILES; do
70 PROCLIST=`get_pids $file`
71 if [ "$PROCLIST" ] && kill -0 $PROCLIST 2>/dev/null; then
73 echo -n "[stopped: $file] "
78 if [ "x$OPTIONS" != "x" ]; then
82 test -f /etc/default/stunnel4 && . /etc/default/stunnel4
83 if [ "$ENABLED" = "0" ] ; then
84 echo "$DESC disabled, see /etc/default/stunnel4"
88 test -x $DAEMON || exit 0
94 echo -n "Starting $DESC: "
99 echo -n "Stopping $DESC: "
103 #force-reload does not send a SIGHUP, since SIGHUP is interpreted as a
104 #quit signal by stunnel. I reported this problem to upstream authors.
105 force-reload|restart)
106 echo -n "Restarting $DESC: "
114 echo "Usage: $N {start|stop|force-reload|restart}" >&2