What is the full path to the directory which contains the scripts (or links to the original scripts) to run while the system boots to SysV-init runlevel 2?



Answer: /etc/rc2.d/etc/rc2.d//etc/init.d/rc2.d/etc/init.d/rc2.d/

題解

SysV init的runlevel設定檔目錄為「/etc/rcX.d」或「/etc/init.d/rcX.d」,「X」為runlevel數值(0-9、A、B、C、S)。這個路徑下的設定檔為「/etc/init.d」下的設定檔的符號連結,檔名格式必須要以「S」或是「K」來開頭,再接上兩位數的優先權數值,再接上設定檔名稱。「S」表示執行(start),「K」表示中止(kill)。例如若要在runlevel 2時去中止「/etc/init.d/gpm」,就要在「/etc/rc2.d」中建立出「/etc/rc2.d/K30gpm」符號連結檔,其中的「30」是優先權值,數值愈小會愈先執行。