Getty errors in log constantly looping Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
Greylinux
Posts: 2
Joined: Thu May 23, 2019 9:33 pm

Getty errors in log constantly looping

Post by Greylinux »

Hi ,

I've just started using Dietpi on an Odroid hc1 , using journalctl I see that the log is filled with errors from getty

Code: Select all

May 23 20:29:58 DietPi agetty[2473]: /dev/ttyS0: not a tty
May 23 20:29:58 DietPi agetty[2474]: /dev/ttyS2: not a tty
May 23 20:29:58 DietPi agetty[2475]: /dev/ttyS1: not a tty
May 23 20:30:08 DietPi systemd[1]: serial-getty@ttyS0.service: Service hold-off time over, scheduling restart.
May 23 20:30:08 DietPi systemd[1]: serial-getty@ttyS1.service: Service hold-off time over, scheduling restart.
May 23 20:30:08 DietPi systemd[1]: serial-getty@ttyS2.service: Service hold-off time over, scheduling restart.
May 23 20:30:08 DietPi systemd[1]: Stopped Serial Getty on ttyS2.
May 23 20:30:08 DietPi systemd[1]: Started Serial Getty on ttyS2.
May 23 20:30:08 DietPi systemd[1]: Stopped Serial Getty on ttyS1.
May 23 20:30:08 DietPi systemd[1]: Started Serial Getty on ttyS1.
May 23 20:30:08 DietPi systemd[1]: Stopped Serial Getty on ttyS0.
May 23 20:30:08 DietPi systemd[1]: Started Serial Getty on ttyS0.
May 23 20:30:08 DietPi agetty[2480]: /dev/ttyS2: not a tty
May 23 20:30:08 DietPi agetty[2481]: /dev/ttyS1: not a tty
May 23 20:30:08 DietPi agetty[2482]: /dev/ttyS0: not a tty
May 23 20:30:18 DietPi systemd[1]: serial-getty@ttyS2.service: Service hold-off time over, scheduling restart.
May 23 20:30:18 DietPi systemd[1]: serial-getty@ttyS0.service: Service hold-off time over, scheduling restart.
May 23 20:30:18 DietPi systemd[1]: serial-getty@ttyS1.service: Service hold-off time over, scheduling restart.
May 23 20:30:18 DietPi systemd[1]: Stopped Serial Getty on ttyS1.
May 23 20:30:18 DietPi systemd[1]: Started Serial Getty on ttyS1.
May 23 20:30:18 DietPi systemd[1]: Stopped Serial Getty on ttyS0.
May 23 20:30:18 DietPi systemd[1]: Started Serial Getty on ttyS0.
May 23 20:30:18 DietPi systemd[1]: Stopped Serial Getty on ttyS2.
this is a fresh minimal install nothing else installed

any help would be much appreciated
Greylinux
Posts: 2
Joined: Thu May 23, 2019 9:33 pm

Re: Getty errors in log constantly looping

Post by Greylinux »

I have sort of fixed it but I'm not 100% sure it is the correct way but I did

Code: Select all

systemctl stop getty@ttyS1
systemctl disable getty@ttyS1
systemctl mask serial-getty@ttyS1.service
for ttyS0 ,ttyS1 and ttyS2

the logs have gone so hopefully everything is fine .
User avatar
MichaIng
Site Admin
Posts: 2281
Joined: Sat Nov 18, 2017 6:21 pm

Re: Getty errors in log constantly looping

Post by MichaIng »

@Greylinux
The last DietPi version should have fixed that by disabling all serial-getty instances that do not have a valid serial device as target. Note that you mixed regular getty and serial-getty, so in your case it should be:

Code: Select all

systemctl stop serial-getty@ttyS0
systemctl stop serial-getty@ttyS1
systemctl stop serial-getty@ttyS2
systemctl stop serial-getty@ttyS3
systemctl disable serial-getty@ttyS0
systemctl disable serial-getty@ttyS1
systemctl disable serial-getty@ttyS2
systemctl disable serial-getty@ttyS3
Masking should not be required.

You can control individual serial consoles via dietpi-config > Advanced Options > Serial/UART
Or you can disable all of them at once: /DietPi/dietpi/func/dietpi-set_hardware serialconsole disable
brtravel
Posts: 51
Joined: Sat Sep 16, 2017 2:04 pm

Re: Getty errors in log constantly looping

Post by brtravel »

I was trying to check if a cronjob has been running and came across this error with journalctl. It haven't noticed any problems caused by this, but it bothers me that this unknown-to-me service is running (and failing?) every 10 seconds. Here's the log, which then repeats every 10 seconds:

Code: Select all

Mar 08 07:44:16 DietPi systemd[1]: serial-getty@ttyS2.service: Service hold-off 
time over, scheduling restart.
Mar 08 07:44:16 DietPi systemd[1]: serial-getty@ttyS0.service: Service hold-off 
time over, scheduling restart.
Mar 08 07:44:16 DietPi systemd[1]: serial-getty@ttyS1.service: Service hold-off 
time over, scheduling restart.
Mar 08 07:44:16 DietPi systemd[1]: Stopped Serial Getty on ttyS1.
Mar 08 07:44:16 DietPi systemd[1]: Started Serial Getty on ttyS1.
Mar 08 07:44:16 DietPi systemd[1]: Stopped Serial Getty on ttyS0.
Mar 08 07:44:16 DietPi systemd[1]: Started Serial Getty on ttyS0.
Mar 08 07:44:16 DietPi systemd[1]: Stopped Serial Getty on ttyS2.
Mar 08 07:44:16 DietPi systemd[1]: Started Serial Getty on ttyS2.
Mar 08 07:44:16 DietPi agetty[4918]: /dev/ttyS1: not a tty
Mar 08 07:44:16 DietPi agetty[4919]: /dev/ttyS0: not a tty
Mar 08 07:44:16 DietPi agetty[4920]: /dev/ttyS2: not a tty
Is this a problem? Is it useful in any way? Can/should I stop it (and how?)?
User avatar
Joulinar
Posts: 2034
Joined: Sat Nov 16, 2019 12:49 am

Re: Getty errors in log constantly looping

Post by Joulinar »

Hi,

short question. Do you use serial console at all? If not, the solution is provide in the post above
Or you can disable all of them at once: /DietPi/dietpi/func/dietpi-set_hardware serialconsole disable
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
User avatar
MichaIng
Site Admin
Posts: 2281
Joined: Sat Nov 18, 2017 6:21 pm

Re: Getty errors in log constantly looping

Post by MichaIng »

Yes, if you don't use any serial console, simply disable all of them. If you use one, preferably you use a single tty only (most likely ttyS0) and disable all others like systemctl disable --now serial-getty@ttyS1 ...

Currently, on image creation, we enable a serial console/getty on all serial devices the machine has. In case of Armbian-based images, I adjust them so that only the default/intended debug serial console is enabled for login as well. In other SBC cases the problem is that there are usually several available, but there is no generic rule about which is used/available/intended for serial login and attached to related GPIO pins and which is used for Bluetooth and/or other features. In case of x86 systems, there are usually ttyS0 ttyS1 ttyS2 and ttyS3 all available, hence a serial-getty console enabled on all of them. I am not sure how to handle best, enable only ttyS0 by default? However generally having them enabled does not hurt, they will fail quickly on boot, if not usable. And all serial consoles can be disabled either via dietpi.txt before first boot or via the command mentioned by Joulinar or via dietpi-config > Advanced Options > Serial/UART.
Post Reply