Jonathan Hutchins' Blog
Wednesday, August 26, 2015
Shutting down spare ttys with upstart
A lot of people will still be dealing with upstart even as the stamped to systemd takes us into new territory. Company environments not ready to move off of RedHat or CentOS 6 for the most part, including many government organizations. Most of my admin knowledge is still in SysV init, and I'm still learning upstart while trying to gradually duplicate my skills in systemd.In SysV, if you had a headless system where six virtual consoles didn't make sense and cluttered up the process list, you simply commented out for or five in /etc/inittab. Then we went to inittab and got the message that things had moved.
In RH?Centos 6, the number of ttys to start is set by an environment variable in /etc/init/start-ttys.conf. What I do is change ACTIVE_CONSOLES from /dev/tty[1-6] to [1-2]. This covers starting the ttys at boot, but if you change it and kill the ttys they still respawn.
What you need to do is
initctl stop tty TTY=/dev/tty3
Then repeat this for each of the other spare
You can do this with a for loop:
for f in {3..6};do stop tty TTY=/dev/tty$f;done
There may be prettier ways to do this, but it works.
J. Hutchins, 26 August 2015