4 # Required-Start: $remote_fs $syslog
5 # Required-Stop: $remote_fs $syslog
6 # Default-Start: 2 3 4 5
8 # Short-Description: Start daemon at boot time
9 # Description: Enable service provided by daemon.
17 pid_file="/var/run/$name.pid"
18 stdout_log="/var/log/$name.log"
19 stderr_log="/var/log/$name.err"
26 [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
32 echo "Already started"
36 if [ -z "$user" ]; then
37 sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
39 sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
43 echo "Unable to start, see $stdout_log and $stderr_log"
50 echo -n "Stopping $name.."
64 echo "Not stopped; may still be shutting down or shutdown may have failed"
68 if [ -f "$pid_file" ]; then
79 echo "Unable to stop, will not attempt to start"
93 echo "Usage: $0 {start|stop|restart|status}"