4 # Required-Start: $local_fs $remote_fs $network
5 # Required-Stop: $local_fs $remote_fs $network
6 # Default-Start: 2 3 4 5
8 # Short-Description: SILC server
9 # Description: A server for the Secure Live Internet Conferencing (SILC)
13 # Author: Jérémy Bobbio <lunar@debian.org>
15 # PATH should only include /usr/* if it runs after the mountnfs.sh script
16 PATH=/sbin:/usr/sbin:/bin:/usr/bin
19 DAEMON=/usr/sbin/$NAME
20 PIDFILE=/var/run/$NAME.pid
21 SCRIPTNAME=/etc/init.d/$NAME
22 CONFIGFILE=/etc/$NAME/$NAME.conf
24 # Exit if the package is not installed
25 [ -x "$DAEMON" ] || exit 0
27 # Exit if configuration file is not readable
28 [ -r "$CONFIGFILE" ] || exit 0
32 sed -n -e "s/^[^#]*$PARAMETER *= *\"\([^\"]*\)\".*$/\1/p" "$CONFIGFILE"
35 PRIVATE_KEY="$(read_config PrivateKey)"
37 # Exit if private key is not readable
38 [ -r "$PRIVATE_KEY" ] || exit 0
40 # Load the VERBOSE setting and other rcS variables
43 # Define LSB log_* functions.
44 # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
45 . /lib/lsb/init-functions
49 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
50 --test > /dev/null || return 1
51 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
57 start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \
58 --pidfile $PIDFILE --name $NAME
60 [ "$RETVAL" = 2 ] && return 2
61 start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 \
63 [ "$?" = 2 ] && return 2
69 start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE \
76 [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
79 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
80 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
84 [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
87 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
88 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
92 log_daemon_msg "Reloading $DESC" "$NAME"
97 log_daemon_msg "Restarting $DESC" "$NAME"
104 1) log_end_msg 1 ;; # Old process is still running
105 *) log_end_msg 1 ;; # Failed to start
115 echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2