I run the website and several services of my small company on a VPS (running CentOS 6.8) on which I have full administrative rights.

Due to trying to pinpoint a memory leak issue in PHP scripts, I've been monitoring the VPS for some time and I have once again looked at the logs. What I see is a long string of log messages, such as these:

screenshot of the error messages

I would like to solve whatever configuration problems cause these errors to "pollute" the system logs, because they make the logs unusable. Every 5 seconds, I get a batch of these:

    Feb 17 12:43:03 vpsxxxxx init: tty (/dev/tty2) main process (1381) terminated with status 1
    Feb 17 12:43:03 vpsxxxxx init: tty (/dev/tty2) main process ended, respawning
    Feb 17 12:43:03 vpsxxxxx init: tty (/dev/tty1) main process (1382) terminated with status 1
    Feb 17 12:43:03 vpsxxxxx init: tty (/dev/tty1) main process ended, respawning
    Feb 17 12:43:03 vpsxxxxx /sbin/mingetty[1419]: tty2: no controlling tty: Operation not permitted
    Feb 17 12:43:03 vpsxxxxx /sbin/mingetty[1420]: tty1: no controlling tty: Operation not permitted

By the time the logs are rotated (on a weekly basis), I'm looking at over 60 MB in the log file, which brings nano to its knees.

I have no idea how necessary mingetty is to normal operation on the VPS (or to connecting via SSH). I'm the only one administering the server but I rarely use more than 2 simultaneous SSH connections.

Is there a solution to this amount of log messages related to mingetty?


As your machine is a VM, you can disable totally mingetty and virtual consoles, as stated on http://www.tldp.org/HOWTO/Remote-Serial-Console-HOWTO/getty-mingetty.html :

If the machine does not have a video card then remove all the mingetty entries from /etc/inittab.

As you are using CentOS 6, I suppose you have upstart and that there is no inittab. To disable tty you can create two files /etc/init.d/tty1.override and /etc/init.d/tty2.override only containing the word 'manual' (all commands are to be passed as root) :

echo manual > /etc/init/tty1.override
echo manual > /etc/init/tty2.override

But I recommend you to do some test before : stop tty1 and stop tty2, and try to open a new ssh connection. If it works, proceed with disabling tty1 and tty2.

  • I have tried these instructions, to no avail. According to this thread on a forum, there was a bug in CentOS, and it's still amazingly there in 6.8. Anyway, I've reduced the number of ttys to 2 instead of 6, but I see the same problem of numerous logs when tailing /var/log/messages. – AbVog Feb 17 '17 at 19:49

@Hexdump led me to the solution through the reading that I had to do about upstart. Many thanks.

The solution for me came in two steps:

  • nano /etc/init/start-ttys.override (file contents further below)
  • shutdown -r now

The contents of the override file is:

env ACTIVE_CONSOLES=/dev/tty[1-1]

end script

Basically, I am replacing the problematic script that launches the mingetty instances with a no-op script.

The first line is a remnant of my trying to reduce the number of ttys, as per this thread, which also reveals that there is a bug in the way ACTIVE_CONSOLES is handled. This bug is the reason why a reboot was necessary. I am not sure this first line is necessary.

Problem solved, but I believe that the root cause is still to be solved, which leaves me with a sour aftertaste, so to speak: if I had had this log pollution issue on an actual machine, I would not have been able to disable the script. Therefore, I see it as a half-baked solution but for now, it's good enough for the current situation.

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.