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.
12 HTTP_PROXY=$(cat /opt/config/http_proxy.txt)
13 HTTPS_PROXY=$(cat /opt/config/https_proxy.txt)
15 if [ $HTTP_PROXY != " " ]
17 export http_proxy=$HTTP_PROXY
18 export https_proxy=$HTTPS_PROXY
22 cmd="./aaf_vm_init.sh"
26 pid_file="/var/run/$name.pid"
27 stdout_log="/var/log/$name.log"
28 stderr_log="/var/log/$name.err"
35 [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
41 echo "Already started"
45 if [ -z "$user" ]; then
46 sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
48 sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
52 echo "Unable to start, see $stdout_log and $stderr_log"
59 echo -n "Stopping $name.."
73 echo "Not stopped; may still be shutting down or shutdown may have failed"
77 if [ -f "$pid_file" ]; then
88 echo "Unable to stop, will not attempt to start"
102 echo "Usage: $0 {start|stop|restart|status}"