Getty flooding syslog after kernel upgrade with "cannot open as standard input"
Solution 1
I had this same issue with a Rackspace-hosted server that I recently upgraded to Ubuntu 12.04 LTS. My /var/log/auth.log file was getting flooded with
May 13 12:50:40 foo getty[1796]: /dev/tty2: cannot open as standard input: No such device
May 13 12:50:51 foo getty[1798]: /dev/tty3: cannot open as standard input: No such device
May 13 12:50:51 foo getty[1797]: /dev/tty4: cannot open as standard input: No such device
May 13 12:50:52 foo getty[1800]: /dev/tty5: cannot open as standard input: No such device
May 13 12:50:52 foo getty[1799]: /dev/tty6: cannot open as standard input: No such device
All I did was remove (after backing up) the following files:
/etc/init/tty[2-6].conf
After I rebooted the problem was solved. No more noise in the log file and the Rackspace console still works, although with only one virtual terminal. (I never use virtual terminals on the console anyway.)
Solution 2
Look to see if those devices exist:
ls -l /dev/tty[2-6]
If they don't then do this:
cd /dev
MAKEDEV -n console
That command name is in all caps. The -n
switch (for "no action") will show you the actions MAKEDEV
will take. If you are satisfied with what it proposes, then change the -n
to -v
(for "verbose") and run it again.
Related videos on Youtube
EvanK
In my short career, I've worn many hats and filled many roles. I've done software development, desktop support, server administration, network engineering; you name it, and I've probably done it in some shape or form.
Updated on September 17, 2022Comments
-
EvanK over 1 year
I just updated my kernel on an Ubuntu 9.10 system from 2.6.32.1 to 2.6.33.5, and everything seemed to go well, except now my system log is getting flooded with errors from getty:
Jul 25 11:01:54 kobol getty[2414]: /dev/tty4: cannot open as standard input: No such device Jul 25 11:01:54 kobol getty[2415]: /dev/tty2: cannot open as standard input: No such device Jul 25 11:01:54 kobol getty[2416]: /dev/tty6: cannot open as standard input: No such device Jul 25 11:01:54 kobol getty[2417]: /dev/tty3: cannot open as standard input: No such device Jul 25 11:01:54 kobol getty[2418]: /dev/tty5: cannot open as standard input: No such device Jul 25 11:01:54 kobol init: tty4 main process (2409) terminated with status 1 Jul 25 11:01:54 kobol init: tty4 main process ended, respawning Jul 25 11:01:54 kobol init: tty2 main process (2410) terminated with status 1 Jul 25 11:01:54 kobol init: tty2 main process ended, respawning Jul 25 11:01:54 kobol init: tty6 main process (2411) terminated with status 1 Jul 25 11:01:54 kobol init: tty6 main process ended, respawning Jul 25 11:01:54 kobol init: tty3 main process (2412) terminated with status 1 Jul 25 11:01:54 kobol init: tty3 main process ended, respawning Jul 25 11:01:54 kobol init: tty5 main process (2413) terminated with status 1 Jul 25 11:01:54 kobol init: tty5 main process ended, respawning
Any idea what is causing this and how to get it to stop? I realize its not a critical issue, but it's still annoying that it's constantly happening (and filling up log files) and I don't know why.
UPDATE: This is the listing for my tty devices, the permissions of which seem to be reset on reboot
crw------- 1 root root 4, 0 2010-07-26 10:00 /dev/tty1 crw--w---- 1 root tty 4, 1 2010-07-26 10:00 /dev/tty2 crw--w---- 1 root tty 4, 2 2010-07-26 10:00 /dev/tty3 crw--w---- 1 root tty 4, 3 2010-07-26 10:00 /dev/tty4 crw--w---- 1 root tty 4, 4 2010-07-26 10:00 /dev/tty5 crw--w---- 1 root tty 4, 5 2010-07-26 10:00 /dev/tty6 crw--w---- 1 root tty 4, 6 2010-07-26 10:00 /dev/tty7 crw--w---- 1 root tty 4, 7 2010-07-26 10:00 /dev/tty8
And the init script for tty1:
# tty1 - getty # # This service maintains a getty on tty1 from the point the system is # started until it is shut down again. start on stopped rc RUNLEVEL=[2345] stop on runlevel [!2345] respawn exec /sbin/getty -8 38400 tty1
And the (practically identical) init scripts for tty2-tty6:
# tty2 - getty # # This service maintains a getty on tty2 from the point the system is # started until it is shut down again. start on runlevel [23] stop on runlevel [!23] respawn exec /sbin/getty -8 38400 tty2
UPDATE 2: Permissions for the init scripts follow...
-rw-r--r-- 1 root root 228 2009-12-10 11:00 /etc/init/tty1.conf -rw-r--r-- 1 root root 213 2009-12-10 11:00 /etc/init/tty2.conf -rw-r--r-- 1 root root 213 2009-12-10 11:00 /etc/init/tty3.conf -rw-r--r-- 1 root root 213 2009-12-10 11:00 /etc/init/tty4.conf -rw-r--r-- 1 root root 213 2009-12-10 11:00 /etc/init/tty5.conf -rw-r--r-- 1 root root 213 2009-12-10 11:00 /etc/init/tty6.conf
A grep of running getty instances shows this:
$ ps auxww|grep [g]etty root 2228 0.0 0.2 5992 604 ? Ss+ 10:00 0:00 /sbin/getty -8 38400 tty1 root 6352 0.8 0.2 5988 688 ? Ss 11:06 0:00 /sbin/getty -8 38400 tty3 root 6355 0.5 0.2 5988 684 ? Ss 11:06 0:00 /sbin/getty -8 38400 tty4 root 6356 0.5 0.2 5988 684 ? Ss 11:06 0:00 /sbin/getty -8 38400 tty6 root 6357 0.8 0.2 5988 684 ? Ss 11:06 0:00 /sbin/getty -8 38400 tty2 root 6358 0.6 0.2 5988 684 ? Ss 11:06 0:00 /sbin/getty -8 38400 tty5
UPDATE 3: After downgrading to 2.6.32.1 the errors disappeared. I recently upgraded again to 2.6.34.1 and they showed up again. I'm superbly baffled now.
-
EvanK almost 14 yearsGood suggestion, but I checked & I have existing devices through tty8, all with root owner and group.
-
Dennis Williamson almost 14 years@EvanK: Do they have appropriate major and minor device numbers?
-
EvanK almost 14 yearsAs far as I can tell. Major number is 4 for all of them, minor goes from 0 to 7 in order
-
Dennis Williamson almost 14 years@EvanK: What do your
/etc/init/tty[2-6].conf
files look like? They should be similar to/etc/init/tty1.conf
(except that it starts and stops on more runlevels). Are the permissions of/dev/tty[2-6]
the same astty1
("crw-------" or "crw--w----")? Just for the heck of it, you might try deleting 2-6 and runningMAKEDEV
anyway. -
EvanK almost 14 yearsThis is strange...I deleted 2-8 and couldnt recreate them, so I rebooted (which apparently recreated them). Now, tty1 is "crw------- 1 root root" while the others are "crw--w---- 1 root tty". I chowned & chmodded them to match tty1 & rebooted, and their permissions were reset to "crw--w---- 1 root tty" during the reboot.
-
Dennis Williamson almost 14 years@EvanK: Weird. My 9.10 system has tty[1-6] all at "crw------- 1 root root". The ones that don't have corresponding
/etc/init/tty?.conf
(getty) are "crw--w---- 1 root tty". What doesps auxww|grep [g]etty
show? What are the permissions/ownership (and dates) of/etc/init/tty?.conf
? -
EvanK almost 14 yearsThe init scripts all have the same permissions and same modified date (of presumably the date of the original install). Updated question w/ the details
-
Dennis Williamson almost 14 years@EvanK: Those question marks in the output of
ps
tell me that something is running on those ttys. Take a look at each of these:ps auxww|grep [t]ty.|grep -v "/sbin/getty"
,lsof /dev/tty[1-8]
and doessudo cat /dev/vcs2
show a login prompt or something else? -
EvanK almost 14 yearsThe first two commands produce no output, and as for the third,
/dev/vcs2
doesn't exist -
Dennis Williamson almost 14 years@EvanK: Do you have
/dev/vcsa[1-8]
? -
Dennis Williamson almost 14 years@EvanK: I'm stuck. Are you able to boot into the previous kernel and if so does this problem happen then?
-
EvanK almost 14 yearsNo, I have no vcs* in /dev/, those are video devices right? That would make sense then, this is a headless box with only console access. I will try reverting to the old kernel during off-peak hours and see if the problem persists. Thanks!
-
Dennis Williamson almost 14 years@EvanK: No, the "v" stands for "virtual". They are the device entries for virtual console memory. They contain what's shown on the screen of tty[1-8]. See
man vcs
. I wonder if their absence could be the problem. The man page gives instructions for creating them. -
EvanK almost 14 years@Dennis:
No manual entry for vcs
, perhaps i need to install something, butapt-cache search vcs
gives me no useful packages -
Dennis Williamson almost 14 years@EvanK: As an alternative, if you're near the server you can just Alt-2 to virtual console 2 and see if there's a login prompt (and try to log in to see if it works). Otherwise, I'm still stuck. No luck on the previous kernel?
-
EvanK almost 14 years@Dennis, I missed my window yesterday, so I switched out the kernels just recently. I'm running .32.1 again and, though I still don't have any vcs devices, the flood of tty error messages has apparently stopped.
-
Thorbjørn Lindeijer almost 12 yearsYep, same here. Apparently the problem exist already since a while: forum.slicehost.com/index.php?p=/discussion/4974/…. Basically, when while upgrading it asks whether to put back these "removed" files, you shouldn't do it I guess. :-)