Last active
January 3, 2016 02:29
-
-
Save oppara/8395864 to your computer and use it in GitHub Desktop.
chkconfigを利用した起動スクリプトひな形 <http://qiita.com/inouet@github/items/11b8338bbd0093989e97>
This file contains hidden or 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/sh | |
# chkconfig: 345 99 1 | |
# description: sample | |
# processname: sample | |
start() { | |
echo -n "starting sample:" | |
/usr/local/sbin/sample | |
return 0 | |
} | |
stop() { | |
killall sample | |
return 0 | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
*) | |
echo $"Usage: $0 {start|stop}" | |
exit 2 | |
esac | |
exit 0 |
This file contains hidden or 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
chkconfig [起動レベル] [起動時の優先度] [停止時の優先度] | |
# chkconfig --add <起動スクリプト名> | |
# chkconfig <起動スクリプト名> on |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment