Ubuntu 有 8 个运行级别(0-6 和 S),我想添加运行级别 7。
我做了以下事情:
1.- 创建文件夹/etc/rc7.d/,其中包含一些指向/etc/init.d/的符号链接
2.- 创建文件/etc/event.d/rc7这是它的内容:
# rc7 - runlevel 7 compatibility
#
# This task runs the old sysv-rc runlevel 7 ("multi-user") scripts. It
# is usually started by the telinit compatibility wrapper.
start on runlevel 7
stop on runlevel [!7]
console output
script
set $(runlevel --set 7 || true)
if [ "$1" != "unknown" ]; then
PREVLEVEL=$1
RUNLEVEL=$2
export PREVLEVEL RUNLEVEL
fi
exec /etc/init.d/rc 7
end script
我认为这就足够了,但是telinit 7仍然会抛出这个错误:telinit: 非法运行级别:7