Skip to main content

Linux Init Configuration (inittab & OpenRC)

[!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

# 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