2009年2月20日 星期五

[Ubuntu]關於update-rc.d 用法

如果在 /etc/init.d 中加入一個 script,還須要製作相關的 link
存到 /etc/rc*.d 中。
K 開頭是 kill , S 開頭是 start , 數字順序代表啟動的順序。
這些動作都可以利用update-rc.d來完成。


例:
在 /etc/init.d 中建立一個叫作 zope 的 script , 然後

update-rc.d zope defaults

就會產生以下連結::

Adding system startup for /etc/init.d/zope ...
/etc/rc0.d/K20zope -> ../init.d/zope
/etc/rc1.d/K20zope -> ../init.d/zope
/etc/rc6.d/K20zope -> ../init.d/zope
/etc/rc2.d/S20zope -> ../init.d/zope
/etc/rc3.d/S20zope -> ../init.d/zope
/etc/rc4.d/S20zope -> ../init.d/zope
/etc/rc5.d/S20zope -> ../init.d/zope

其他進階使用方式請 man update-rc.d

延伸閱讀: Debian和RH的差異這一篇內容是在講下述內容
<使用Debian工具進行工作>
RH包含了一些用於自動管理SysV初始腳本過程的工具,也就是chkconfig民service。
Debian並包含這些工具,但是卻提供相似的管理工具:update-rc.d與invoke-rc.d。

沒有留言: