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
发布于 2008-09-22 03:15:10
不能;运行级是硬编码到实用程序中的。但你为什么要这么做?运行级别4基本上是未使用的。虽然这不是最好的主意,但如果您总是/从不使用X,则可以重新调整运行级3或运行级5的用途。
请注意,一些*nix系统支持6个以上的运行级别,但Linux不是其中之一。
发布于 2008-09-22 03:24:12
我不知道如何添加它们(从来不需要),但我非常确定/etc/inittab是添加运行级的地方。
尽管我不得不同意Zathrus的观点,其他的运行级是可用的,但是没有使用。在Debian上,实际上只使用了1和2。不过,我不知道Ubuntu是如何设置的。然而,如果你有一个特定的目的,这应该是可能的。我从来没必要这么做。
https://stackoverflow.com/questions/112964
复制相似问题