A system with SysV-init has a service installed called apache2. Which file controls the start and stop of this service and is referenced by the various runlevel directories?
A. /etc/init.d/apache2
B. /etc/rc2.d/70apache2
C. /etc/rc2.d/apache2
D. /etc/rc2.d/apache2.start
题解
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」是优先权值,数值愈小会愈先运行。
因此这题的答案是选项「A」。
