わいえむねっと

Contents
Categories
Calendar
2007/06
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Monthly Archives
~2000/01
Recent Entries
RSS1.0
Templates
Information
Processed: 0.018 sec
Chashed: -
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で制御と。