跳至正文
Wener Notes

Linux Init Configuration (inittab & OpenRC)

约 1 分钟阅读
标签:Linux管理初始化OpenRCSysVinit

[!NOTE] Note that when using openrc-init, the /etc/inittab file is not used. To hide boot messages from OpenRC, you can edit /etc/inittab and add --quiet to every openrc command.

inittab example

/etc/inittab
::sysinit:/sbin/openrc sysinit
::sysinit:/sbin/openrc boot
::wait:/sbin/openrc default

# Set up a couple of getty's
tty1::respawn:/sbin/getty 38400 tty1
tty2::respawn:/sbin/getty 38400 tty2
tty3::respawn:/sbin/getty 38400 tty3
tty4::respawn:/sbin/getty 38400 tty4
tty5::respawn:/sbin/getty 38400 tty5
tty6::respawn:/sbin/getty 38400 tty6

# Put a getty on the serial port
#ttyS0::respawn:/sbin/getty -L ttyS0 115200 vt100

# Stuff to do for the 3-finger salute
::ctrlaltdel:/sbin/reboot

# Stuff to do before rebooting
::shutdown:/sbin/openrc shutdown

Snippets

bash
# Add agetty for tty 1-6
for n in $(seq 1 6); do
  ln -s agetty agetty.tty$n
  rc-config add agetty.tty$n default
done

Troubleshooting

关联信息

反向链接、本文链接的其他页面和外部资料。

参考资料

其他外链4 条
最近更新commit 906e816编辑