1
0
mirror of https://github.com/systemd/systemd.git synced 2025-08-25 13:49:55 +03:00

Merge pull request #6579 from sourcejedi/getty

getty nitpicks
This commit is contained in:
Lennart Poettering
2017-08-10 12:05:21 +02:00
committed by GitHub
4 changed files with 23 additions and 14 deletions

View File

@ -55,12 +55,14 @@
<para><filename>systemd-getty-generator</filename> is a generator <para><filename>systemd-getty-generator</filename> is a generator
that automatically instantiates that automatically instantiates
<filename>serial-getty@.service</filename> on the kernel console <filename>serial-getty@.service</filename> on the kernel
<filename>/dev/console</filename> if that is not directed to the console(s), if they can function as ttys and are not provided by
virtual console subsystem. It will also instantiate the virtual console subsystem. It will also instantiate
<filename>serial-getty@.service</filename> instances for <filename>serial-getty@.service</filename> instances for
virtualizer consoles, if execution in a virtualized environment is virtualizer consoles, if execution in a virtualized environment is
detected. Finally, it will instantiate detected. If execution in a container environment is detected, it
will instead enable <filename>console-getty.service</filename> for
<filename>/dev/console</filename>, and
<filename>container-getty@.service</filename> instances for <filename>container-getty@.service</filename> instances for
additional container pseudo TTYs as requested by the container additional container pseudo TTYs as requested by the container
manager (see <ulink manager (see <ulink
@ -78,8 +80,8 @@
<para><filename>systemd-getty-generator</filename> implements <para><filename>systemd-getty-generator</filename> implements
<citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para> <citerefentry><refentrytitle>systemd.generator</refentrytitle><manvolnum>7</manvolnum></citerefentry>.</para>
<para>Further information about configuration of gettys you may <para>Further information about configuration of gettys can be
find in found in
<ulink url="http://0pointer.de/blog/projects/serial-console.html">systemd <ulink url="http://0pointer.de/blog/projects/serial-console.html">systemd
for Administrators, Part XVI: Gettys on Serial Consoles (and for Administrators, Part XVI: Gettys on Serial Consoles (and
Elsewhere)</ulink>.</para> Elsewhere)</ulink>.</para>

View File

@ -201,16 +201,16 @@ int main(int argc, char *argv[]) {
return EXIT_FAILURE; return EXIT_FAILURE;
} }
/* We assume that gettys on virtual terminals are
* started via manual configuration and do this magic
* only for non-VC terminals. */
if (isempty(tty) || tty_is_vc(tty)) if (isempty(tty) || tty_is_vc(tty))
continue; continue;
if (verify_tty(tty) < 0) if (verify_tty(tty) < 0)
continue; continue;
/* We assume that gettys on virtual terminals are
* started via manual configuration and do this magic
* only for non-VC terminals. */
if (add_serial_getty(tty) < 0) if (add_serial_getty(tty) < 0)
return EXIT_FAILURE; return EXIT_FAILURE;
} }

View File

@ -7,14 +7,16 @@
[Unit] [Unit]
Description=Console Getty Description=Console Getty
Documentation=man:agetty(8) Documentation=man:agetty(8) man:systemd-getty-generator(8)
After=systemd-user-sessions.service plymouth-quit-wait.service After=systemd-user-sessions.service plymouth-quit-wait.service
ConditionPathExists=/dev/console
m4_ifdef(`HAVE_SYSV_COMPAT', m4_ifdef(`HAVE_SYSV_COMPAT',
After=rc-local.service After=rc-local.service
)m4_dnl )m4_dnl
Before=getty.target Before=getty.target
# OCI containers may be run without a console
ConditionPathExists=/dev/console
[Service] [Service]
# The '-o' option value tells agetty to replace 'login' arguments with an # The '-o' option value tells agetty to replace 'login' arguments with an
# option to preserve environment (-p), followed by '--' for safety, and then # option to preserve environment (-p), followed by '--' for safety, and then
@ -22,7 +24,6 @@ Before=getty.target
ExecStart=-/sbin/agetty -o '-p -- \\u' --noclear --keep-baud console 115200,38400,9600 $TERM ExecStart=-/sbin/agetty -o '-p -- \\u' --noclear --keep-baud console 115200,38400,9600 $TERM
Type=idle Type=idle
Restart=always Restart=always
RestartSec=0
UtmpIdentifier=cons UtmpIdentifier=cons
TTYPath=/dev/console TTYPath=/dev/console
TTYReset=yes TTYReset=yes

View File

@ -7,7 +7,8 @@
[Unit] [Unit]
Description=Container Getty on /dev/pts/%I Description=Container Getty on /dev/pts/%I
Documentation=man:agetty(8) man:machinectl(1) Documentation=man:agetty(8) man:systemd-getty-generator(8)
Documentation=man:machinectl(1)
After=systemd-user-sessions.service plymouth-quit-wait.service After=systemd-user-sessions.service plymouth-quit-wait.service
m4_ifdef(`HAVE_SYSV_COMPAT', m4_ifdef(`HAVE_SYSV_COMPAT',
After=rc-local.service After=rc-local.service
@ -16,6 +17,11 @@ Before=getty.target
IgnoreOnIsolate=yes IgnoreOnIsolate=yes
ConditionPathExists=/dev/pts/%I ConditionPathExists=/dev/pts/%I
# IgnoreOnIsolate is an issue: when someone isolates rescue.target,
# tradition expects that we shut down all but the main console.
Conflicts=rescue.service
Before=rescue.service
[Service] [Service]
# The '-o' option value tells agetty to replace 'login' arguments with an # The '-o' option value tells agetty to replace 'login' arguments with an
# option to preserve environment (-p), followed by '--' for safety, and then # option to preserve environment (-p), followed by '--' for safety, and then