mirror of
https://github.com/systemd/systemd.git
synced 2024-11-13 23:21:08 +03:00
4bf04322b8
For pluggable ttys such as USB serial devices, the getty is restarted and exits in a loop until the remove event reaches systemd. Under certain circumstances the restart loop can overload the system in a way that prevents the remove event from reaching systemd for a long time (e.g. at least several minutes on a small embedded system). Use the default RestartSec to prevent the restart loop from overloading the system. Serial gettys are interactive units, so waiting an extra 100ms really doesn't make a difference anyways compared to the time it takes the user to log in.
38 lines
1.0 KiB
Plaintext
38 lines
1.0 KiB
Plaintext
# This file is part of systemd.
|
|
#
|
|
# systemd is free software; you can redistribute it and/or modify it
|
|
# under the terms of the GNU Lesser General Public License as published by
|
|
# the Free Software Foundation; either version 2.1 of the License, or
|
|
# (at your option) any later version.
|
|
|
|
[Unit]
|
|
Description=Serial Getty on %I
|
|
Documentation=man:agetty(8) man:systemd-getty-generator(8)
|
|
Documentation=http://0pointer.de/blog/projects/serial-console.html
|
|
BindsTo=dev-%i.device
|
|
After=dev-%i.device systemd-user-sessions.service plymouth-quit-wait.service
|
|
m4_ifdef(`HAVE_SYSV_COMPAT',
|
|
After=rc-local.service
|
|
)m4_dnl
|
|
|
|
# If additional gettys are spawned during boot then we should make
|
|
# sure that this is synchronized before getty.target, even though
|
|
# getty.target didn't actually pull it in.
|
|
Before=getty.target
|
|
IgnoreOnIsolate=yes
|
|
|
|
[Service]
|
|
ExecStart=-/sbin/agetty --keep-baud 115200,38400,9600 %I $TERM
|
|
Type=idle
|
|
Restart=always
|
|
UtmpIdentifier=%I
|
|
TTYPath=/dev/%I
|
|
TTYReset=yes
|
|
TTYVHangup=yes
|
|
KillMode=process
|
|
IgnoreSIGPIPE=no
|
|
SendSIGHUP=yes
|
|
|
|
[Install]
|
|
WantedBy=getty.target
|