memo.xight.org

日々のメモ

Debian GNU/Linux での /etc/rc?.d/ 操作

Summary

/usr/sbin/update-rc.d を用いる

すべてのランレベルでサービスの起動停止

# update-rc.d -f inetd remove


ランレベル5でinetdを停止

# update-rc.d inetd stop 20 5 .


デフォルトの起動,停止リンクを作成

ランレベル 2,3,4,5 にサービスの起動用リンクを作成,ランレベル 0,1,6 にサービスの停止用リンクを
シーケンスコード 90で作成

# update-rc.d postgres defaults 90

以下のシンボリックリンクが作成される.
/etc/rc0.d/K90postgres -> ../init.d/service/K90postgres
/etc/rc1.d/K90postgres -> ../init.d/service/K90postgres
/etc/rc2.d/S90postgres -> ../init.d/service/S90postgres
/etc/rc3.d/S90postgres -> ../init.d/service/S90postgres
/etc/rc4.d/S90postgres -> ../init.d/service/S90postgres
/etc/rc5.d/S90postgres -> ../init.d/service/S90postgres
/etc/rc6.d/K90postgres -> ../init.d/service/K90postgres

ランレベル2,3,4,5はS90で起動,ランレベル0,1,6はK10で停止.

#update-rc.d postgres start 90 2 3 4 5 . stop 10 0 1 6 .

以下のシンボリックリンクが作成される.
/etc/rc0.d/K10postgres
/etc/rc1.d/K10postgres
/etc/rc2.d/S90postgres
/etc/rc3.d/S90postgres
/etc/rc4.d/S90postgres
/etc/rc5.d/S90postgres
/etc/rc6.d/K10postgres

Reference

Debianでの起動処理(init)とランレベル(rc.d)の制御
http://park15.wakwak.com/~unixlife/linux/de-init.html