for link in /etc/rc.d/rc3.d/S[0-9][0-9]*; do
test -x "$link" || continue
# omitted optimization: if previous runlevel already started this service, don't start it again
# omitted logic: if $DO_CONFIRM is set, prompt for each service
# omitted logging
$link start; status=$?
# omitted status reporting/logging logic based on value of $status
done
SysVinit 启动/停止脚本根据默认“C”(又名 POSIX)语言环境的排序顺序以字母数字顺序
S99foobar
启动,因此将在任何S99[a-e]*
脚本之后但在任何S99[g-z]*
脚本之前启动。脚本由
/etc/init.d/rc
主脚本启动。相关代码本质上是: