Created
November 16, 2011 06:32
-
-
Save crazylion/1369427 to your computer and use it in GitHub Desktop.
init.d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
start(){ | |
echo "start listening fssm" | |
/etc/xxx/listen.rb & | |
} | |
stop(){ | |
echo "stop listening fssm" | |
killall listen.rb | |
} | |
. /lib/lsb/init-functions | |
case "$1" in | |
start) | |
log_daemon_msg "Starting dimensionplus fssm" | |
log_progress_msg "Starting dimensionplus fssm" | |
start | |
log_end_msg "$?" | |
exit 0 | |
;; | |
stop) | |
log_daemon_msg "Stoping dimensionplus fssm" | |
log_progress_msg "Stop dimensionplus fssm" | |
stop | |
log_end_msg "$?" | |
exit 0 | |
;; | |
reload|restart|force-reload) | |
stop | |
start | |
exit 0 | |
;; | |
**) | |
echo "Usage: $0 {start|stop|reload}" 1>&2 | |
exit 1 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
對阿 listen.rb 就是你自己寫的fssm 的ruby script
是給 init用的函式庫(對不起 我在幹啥, 這不是很直白了嗎)
log_* 那個就是會顯示 start ... success.. stop success 的 輔助顯示用函式