小编Pab*_*blo的帖子

将旧的 sysvinit 习惯移植到 systemd

我有一系列脚本,可以用来安装和配置新的 Debian 稳定系统。要自动启动我使用的程序,/etc/rc.local但在其他情况下,我必须手动更改/etc/inittab文件。我还有其他更改,例如添加--noclear到行中1:2345:respawn:/sbin/getty --noclear 38400 tty1。

因为我必须自定义关闭过程,所以我最终这样做了:

l0:0:wait:/etc/rc.halt 0
...
l6:6:wait:/etc/rc.halt 6
Run Code Online (Sandbox Code Playgroud)

我/etc/rc.halt看起来像这样

#!/bin/sh
#   
# rc.halt
#   
# This script is executed when entering level 6/0 (on halt or reboot)

su - teststand -c "/home/teststand/stop_server.sh"  # my custom command

# making sure the halt/reboot process is resumed
test -n "${1}" && /etc/init.d/rc ${1}

exit 0
Run Code Online (Sandbox Code Playgroud)

今天是我第一次安装新的 Debian 8systemd作为默认初始化系统。我没有想到这一点,首先惊讶的是/etc/inittab文件丢失了。

在我正在运行的系统(@work 和 @home)上,我仍在运行我的系统,sysvinit这就是为什么我在systemd. …

systemd sysvinit

5
推荐指数
1
解决办法
3218
查看次数

标签 统计

systemd ×1

sysvinit ×1