Spaces:
Running
Running
File size: 1,016 Bytes
f8efe2e | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | #!/bin/bash
### BEGIN INIT INFO
# Provides: frwebloader
# Required-Start: $remote_fs $syslog $network
# Required-Stop: $remote_fs $syslog $network
# Should-Start: $network
# Should-Stop: $network
# X-Start-Before: nis
# X-Stop-After: nis
# Default-Start: 3
# Default-Stop: 0
# X-Interactive: true
# Short-Description: ss auto start script
# Description: frapp auto start script,
# This file should be used to construct scripts to be
# placed in /etc/init.d.
### END INIT INFO
Node=node
case "$1" in
start)
echo "start the server:" ${Node}
`nohup ${Node} /usr/local/etc/node/sys/main.js > /tmp/${Node}_log 2>&1 &`
;;
stop)
echo "kill the server:" ${Node}
`nohup ps | grep ${Node} | awk '{print $1}' | xargs kill -9 2>&1 &`
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
;;
esac
exit 0
|