Skip to content

Instantly share code, notes, and snippets.

@oppara
Last active January 3, 2016 02:29
Show Gist options
  • Save oppara/8395864 to your computer and use it in GitHub Desktop.
Save oppara/8395864 to your computer and use it in GitHub Desktop.
chkconfigを利用した起動スクリプトひな形 <http://qiita.com/inouet@github/items/11b8338bbd0093989e97>
#!/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
chkconfig [起動レベル] [起動時の優先度] [停止時の優先度]
# chkconfig --add <起動スクリプト名>
# chkconfig <起動スクリプト名> on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment