- 2007/06/04 Mon
-
自前のrcスクリプトをchkconfig --addするメモ。
/etc/rc.d/init.d下にスクリプトを新規作成。
# chkconfig: にrunlevel((?:[0-6]+|-))、start priority(\d{2})、stop priority(\d{2})を指定。
# description: に説明を記述。# chkconfig: 345 91 35 # description: foo
これらがないとサービス foo は、chkconfig をサポートしていません
とか怒られる。
というか、これさえあれば他に何もなくても怒られない。chkconfigには。
で、daemonとかkillprocを使用するのにfunctionsを取り込み。. /etc/rc.d/init.d/functions
あとは$1がstartとかstopとかrestartとかcondrestartとかreloadとかstatusとかでの処理を記述。
chkconfig --addしたら、あとはserviceで制御と。