gpt4 book ai didi

ubuntu - 如何在 Ubuntu 中添加另一个运行级别(级别 7)?

转载 作者:行者123 更新时间:2023-12-04 19:04:47 25 4
gpt4 key购买 nike

Ubuntu 有 8 个运行级别(0-6 和 S),我想添加运行级别 7。

我做了以下事情:

1.- 创建文件夹/etc/rc7.d/ ,其中包含一些指向 的符号链接(symbolic link)/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

我以为这就够了,但是 远程初始化 7 仍然抛出此错误:telinit:非法运行级别:7

最佳答案

你不能;运行级别被硬编码到实用程序中。但你为什么需要?运行级别 4 基本上未使用。虽然这不是最好的主意,但您可以根据您是否总是/从不使用 X 来重新调整运行级别 3 或运行级别 5 的用途。

请注意,某些 *nix 系统支持超过 6 个运行级别,但 Linux 不是其中之一。

关于ubuntu - 如何在 Ubuntu 中添加另一个运行级别(级别 7)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/112964/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com