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.
11 HTTP_PROXY=$(cat /opt/config/http_proxy.txt)
12 HTTPS_PROXY=$(cat /opt/config/https_proxy.txt)
14 if [ $HTTP_PROXY != "no_proxy" ]
16 export http_proxy=$HTTP_PROXY
17 export https_proxy=$HTTPS_PROXY
21 cmd="./sms_vm_init.sh"
25 pid_file="/var/run/$name.pid"
26 stdout_log="/var/log/$name.log"
27 stderr_log="/var/log/$name.err"
34 [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
40 echo "Already started"
44 if [ -z "$user" ]; then
45 sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
47 sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
51 echo "Unable to start, see $stdout_log and $stderr_log"
58 echo -n "Stopping $name.."
72 echo "Not stopped; may still be shutting down or shutdown may have failed"
76 if [ -f "$pid_file" ]; then
87 echo "Unable to stop, will not attempt to start"
101 echo "Usage: $0 {start|stop|restart|status}"