Last active
December 30, 2015 08:35
-
-
Save igara/aef58b3f85a8d887ea93 to your computer and use it in GitHub Desktop.
[メモ]サーバ起動時に自動で独自のプロセス起動させるには(chkconfig) ref: http://qiita.com/igara/items/ecf46903d7c406d966c3
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
vi /etc/rc.d/init.d/syonet |
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 | |
# chkconfig: 345 99 1 | |
# description: syonet | |
# processname: syonet | |
start(){ | |
if [ -e /root/.phpenv/versions/7.0.0/sbin/php-fpm ]; then | |
nohup /root/.phpenv/versions/7.0.0/sbin/php-fpm & | |
else | |
echo "/root/.phpenv/versions/7.0.0/sbin/php-fpmがないよ!" | |
fi | |
if [ -e /root/http.conf ]; then | |
nohup h2o -c /root/http.conf & | |
else | |
echo "h2oのコンフィグファイル/root/http.confがないよ!" | |
fi | |
if [ -e /root/c9sdk/server.js ] && [ -d /root/slack_rack_php ]; then | |
nohup node /root/c9sdk/server.js -p 8080 -a XXX:XXX -w /root/slack_rack_php/ & | |
else | |
echo "cloud9をcloneした?syonetのcloneは?" | |
fi | |
return 0; | |
} | |
stop(){ | |
echo "not stop" | |
return 0 | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment