1

In old 5.3 rhel, we used to define the number of terminals and their respawn settings in /etc/inittab file as below.

1:2345:respawn:/sbin/mingetty tty1
1:2345:respawn:/sbin/mingetty tty2
1:2345:respawn:/sbin/mingetty tty3
1:2345:respawn:/sbin/mingetty tty4 ....etc for 12 terminals

In new RHEL 6.4, we need to define the terminals in /etc/sysconfig/init file as below

ACTIVE_CONSOLES="/dev/tty[1-9] /dev/tty10 /dev/tty11 /dev/tty12"

Now, how can I turn off the respawn property for any terminal.. say tty5?

1

Unfortunately this is more involved than just editing the /etc/inittab now. I found 2 examples that were helpful:

The gist, modify this file: /etc/init/start-ttys.conf:

script
    . /etc/sysconfig/init
    for tty in $(echo $ACTIVE_CONSOLES) ; do
          [ "$RUNLEVEL" = "5" -a "$tty" = "$X_TTY" ] && continue
            if [ "$tty" == "/dev/tty5" ]; then
                    initctl start no_respawn_tty  TTY=$tty
                    continue
            fi
            initctl start tty TTY=$tty
    done
end script

Then create the corresponding script, /etc/init/no_respawn_tty.conf:

# tty - getty
#
# This service maintains a getty on the specified device.

stop on runlevel [S016]

instance $TTY
exec /sbin/mingetty $TTY
usage 'tty TTY=/dev/ttyX  - where X is console id'

The changes should be seen immediately, I don't think you need to restart anything.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.