4 # Required-Start: $local_fs $remote_fs pulseaudio
5 # Required-Stop: $local_fs $remote_fs
6 # Default-Start: 2 3 4 5
8 # Short-Description: Ursary control panel daemon
11 # Authors: Martin Mares <mj@ucw.cz>
15 # PATH should only include /usr/* if it runs after the mountnfs.sh script
16 PATH=/sbin:/usr/sbin:/bin:/usr/bin:/opt/sbin:/opt/bin
17 DESC="Ursary control panel daemon"
19 DAEMON=/usr/local/sbin/ursaryd
21 PIDFILE=/run/ursaryd.pid
22 SCRIPTNAME=/etc/init.d/$NAME
24 # Exit if the package is not installed
25 [ -x "$DAEMON" ] || exit 0
27 # Read configuration variable file if it is present
28 [ -r /etc/default/$NAME ] && . /etc/default/$NAME
30 # Load the VERBOSE setting and other rcS variables
33 # Define LSB log_* functions.
34 # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
35 . /lib/lsb/init-functions
40 ucw-daemon-control --start --pid-file $PIDFILE -- $DAEMON $DAEMON_ARGS
45 ucw-daemon-control --stop --pid-file $PIDFILE
50 ucw-daemon-control --reload --pid-file $PIDFILE
55 ucw-daemon-control --check --pid-file $PIDFILE
60 [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
63 0) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
64 100) [ "$VERBOSE" != no ] && log_progress_msg "already running" && log_end_msg 0 ;;
65 103) [ "$VERBOSE" != no ] && log_progress_msg "found dead, restarting" && log_end_msg 0 ;;
66 *) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
70 [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
73 0) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
74 100) [ "$VERBOSE" != no ] && log_progress_msg "already stopped" && log_end_msg 0 ;;
75 103) [ "$VERBOSE" != no ] && log_progress_msg "already dead" && log_end_msg 0 ;;
76 *) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
80 log_daemon_msg "Reloading $DESC" "$NAME"
84 101|103) log_progress_msg "is not running" && log_end_msg 1 ;;
89 log_daemon_msg "Restarting $DESC" "$NAME"
95 0|100) log_end_msg 0 ;;
96 103) log_progress_msg "was found dead" && log_end_msg 0 ;;
115 echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2