I've a cloud server, with CentOS distribution, and an Apache instance to manage some web apps, like WordPress or PrestaShop.
I noticed that an error is reported in log files (var/log/
).
- In particular in
messages
:May 30 11:54:41 xxx00962 systemd: Starting Serial Getty on ttyS0... May 30 11:54:41 xxx00962 systemd: Started Serial Getty on ttyS0. May 30 11:54:51 xxx00962 systemd: serial-getty@ttyS0.service holdoff time over, scheduling restart. May 30 11:54:51 xxx00962 systemd: Stopping Serial Getty on ttyS0...
- and in
secure
:May 30 15:51:30 xxx00962 agetty[24693]: /dev/ttyS0: not a character device
where xxx00962
is the (anonymized) hostname.
I don't know what is getty
for, but I'd like to solve the problem.
Someone can help me and explain how getty
works?
Best Answer
getty
is one of the oldest Unix programs. You are using a workalike program written by Wietse Venema,agetty
, that was written whengetty
was around twenty years old.This program is being run because your system thinks that you have a terminal attached to a serial device, with the character device filename
/dev/ttyS0
. When your system bootstrapped, a program namedsystemd-getty-generator
sawttyS0
in/sys/class/tty/console/active
, because of it being listed after aconsole=
in the kernel command line. The generator caused theserial-getty@.service
template service unit to be instantiated asserial-getty@ttyS0.service
; and this is the service whose attempted activations you are seeing being logged.The service provides terminal log-on via that device.
For some reason (presuming that you have a version of systemd from 2014 or later), your system is inconsistent, and now believes that
/dev/ttyS0
is not a character device file, let alone a character device that is a terminal.systemd-getty-generator
thought that it was at bootstrap. There are at least two ways in which it could have changed. Which, if either, has occurred cannot be determined from your question.Fix
/dev/ttyS0
.systemd-getty-generator
checked it. Also stop telling the kernel on its command line that it is the console. If it is not supposed to be a character device, because you do not have a serial port (with terminal attached or without), then telling the kernel that a non-existent serial port is the console is simply wrong.systemd-getty-generator
because its primary functionality is not what you want.Further reading
systemd-getty-generator
. systemd manual pages. freedesktop.org.agetty
. Ubuntu 15.04 manual pages.