Skip to content

Instantly share code, notes, and snippets.

@hngouveia01
Last active October 4, 2016 17:28
Show Gist options
  • Save hngouveia01/75a511dd876d11184392785b65917f44 to your computer and use it in GitHub Desktop.
Save hngouveia01/75a511dd876d11184392785b65917f44 to your computer and use it in GitHub Desktop.
SOLUTION - systemctl hangs and gives "Connection timed out" in every call when using [email protected]
I've stumbled upon this problem after migrating from sysvinit to systemd.
To get the serial console working on systemd I had to set up a service called [email protected]. It uses
agetty as a way to open ports, ask for login name and password.
The problem started after I noticed that my custom program, called with /sbin/agetty -i -n -l <program>, would not recognize the
Enter inserted as a End Of Line (EOL) special char. Then, I had to change from agetty to /bin/busybox getty to get the key recognized.
*latter I learned that this problem could be resolved using the command 'stty cooked'*
However, after using busybox with systemd, I noticed that, if a serial console port was enables but not connected to a client, every
call to systemctl would hang until receives a "Connection timed out" and not execute the command at all.
It took me a while to realize that the problem was busybox.
So, do not use busybox getty with systemd... At least not with serial-ports. Some hardwares have serial ports enabled by default at
BIOS, so your calls to systemctl may hang.
Use /sbin/agetty and then set the terminal environment with stty cooked or something.
https://linux.die.net/man/8/agetty
https://linux.die.net/man/1/stty
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment