I'm getting the following errors every 10-30 seconds on a virtual Red Hat Enterprise Linux 6.5 2 Server on Amazons EC2.

Sep 23 09:57:05 ServerName init: ttyS0 (/dev/ttyS0) main process (1612) terminated with status 1
Sep 23 09:57:05 ServerName init: ttyS0 (/dev/ttyS0) main process ended, respawning
Sep 23 09:57:05 ServerName agetty[1613]: /dev/ttyS0: tcgetattr: Input/output error

Does anyone know what is causing this and how I could go about fixing it?

Thanks.

  • What process is 1612? – eyoung100 Sep 23 '14 at 14:36
  • I'm not totally sure as the process number keeps incrementing by 1 every error (from 1 upwards). – Richard Sep 23 '14 at 14:40
  • Try the steps in this post. Deleting the file will cause it to be recreated. If that doesn't help submit a support ticket. – eyoung100 Sep 23 '14 at 14:49
  • Thanks for the suggestion, I have tried that post and it didn't resolve the issue. So it's looking like it might have to be a ticket. – Richard Sep 23 '14 at 15:21
  • Yup, and like the post says it may be affecting others in the server environment... Makes me curious :) – eyoung100 Sep 23 '14 at 15:23
up vote 8 down vote accepted

A virtual Red Hat installation probably doesn't have any serial ports connected (which is what /dev/ttyS0 is: COM1 in DOS parlance), so trying to start agetty to listen to the serial port is doomed to fail. Find the line in /etc/inittab that contains agetty and ttyS0 and change

respawn to off.

EDIT: In case the system is using upstart, as in redhat 6, do

stop ttyS0

to stop the service now, and do

echo manual | sudo tee /etc/init/ttyS0.override

to prevent starting the service after a reboot according to https://askubuntu.com/a/468250/146273

For documentation purposes, you might also consider doing:

sudo tee -a /etc/init/ttyS0.conf <<EOF

# Disabled. See https://unix.stackexchange.com/a/157489/9745
EOF

Further reading: http://upstart.ubuntu.com/cookbook/#disabling-a-job-from-automatically-starting

  • Hi, I have just had a looked in that file and there isn't any line about agetty. All seem to be commented out and talking about the fact that "inittab is only used by upstart for the default runlevel" and then list a load of start up options. – Richard Sep 25 '14 at 14:23
  • Try "find /etc -type f -exec grep ttyS0 {} +" to see in what file ttyS0 is mentioned. I'm more a Debian man than Red Hat... (the find instead of grep -r is because grep follows symlinks and find doesn't) – wurtel Sep 25 '14 at 14:25
  • Looks like its in two file "/etc/init/ttyS0.conf" and "/etc/init/serial.conf". ttyS0.conf has 5 lines start on stopped rc RUNLEVEL=[2345] || stop on starting runlevel [016] || respawn || instance /dev/ttyS0 || exec /sbin/agetty /dev/ttyS0 115200 vt100-nav ||. I have split each line up with ||, would I change 'respawn' in this file? – Richard Sep 25 '14 at 14:32
  • Try first stop ttyS0 and then renaming the ttyS0.conf file to e.g. ttyS0.conf.NOT. This is part of "upstart", which I don't have experience with. – wurtel Sep 25 '14 at 14:38
  • Alright I will give that a go, will a reboot be required? – Richard Sep 25 '14 at 14:43

I got similar errors after changing from Xen to KVM on my VPS, but about tty1, not tty1S. The fix was to replace /etc/init/tty1.conf with /etc/init/tty1.conf.dpkg-dist. The old file referred to the /dev/hvc0, a Xen virtual device which no longer existed.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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