From 93a45c562a1989dfbb2dd08c65f8a21b02959934 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 25 Aug 2010 03:09:57 +0200 Subject: serial: use seperate getty template for serial ttys --- units/.gitignore | 1 + units/getty@.service.m4 | 2 +- units/serial-getty@.service.m4 | 37 +++++++++++++++++++++++++++++ units/systemd-auto-console-getty.service.in | 16 ------------- units/systemd-auto-serial-getty.service | 16 +++++++++++++ 5 files changed, 55 insertions(+), 17 deletions(-) create mode 100644 units/serial-getty@.service.m4 delete mode 100644 units/systemd-auto-console-getty.service.in create mode 100644 units/systemd-auto-serial-getty.service (limited to 'units') diff --git a/units/.gitignore b/units/.gitignore index 82a24170cf..35f790849e 100644 --- a/units/.gitignore +++ b/units/.gitignore @@ -1,3 +1,4 @@ +serial-getty@.service systemd-kmsg-syslogd.service systemd-modules-load.service systemd-remount-api-vfs.service diff --git a/units/getty@.service.m4 b/units/getty@.service.m4 index 01343c497f..4b65d5b906 100644 --- a/units/getty@.service.m4 +++ b/units/getty@.service.m4 @@ -30,7 +30,7 @@ Before=getty.target [Service] Environment=TERM=linux -ExecStart=GETTY %I +ExecStart=-GETTY %I Restart=restart-always RestartSec=0 KillMode=process-group diff --git a/units/serial-getty@.service.m4 b/units/serial-getty@.service.m4 new file mode 100644 index 0000000000..b91ed98330 --- /dev/null +++ b/units/serial-getty@.service.m4 @@ -0,0 +1,37 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +[Unit] +Description=Serial Getty on %I +Requires=dev-%i.device +After=dev-%i.device +m4_ifdef(`TARGET_FEDORA', +After=rc-local.service +)m4_dnl +m4_ifdef(`TARGET_ARCH', +After=rc-local.service +)m4_dnl + +# If additional gettys are spawned during boot (possibly by +# systemd-auto-console-getty) 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 + +[Service] +Environment=TERM=vt100-nav +m4_ifdef(`TARGET_FEDORA', +ExecStartPre=-/sbin/securetty %I +)m4_dnl +ExecStart=-/sbin/agetty -s %I 115200,38400,9600 +Restart=restart-always +RestartSec=0 +KillMode=process-group + +# Some login implementations ignore SIGTERM, so we send SIGHUP +# instead, to ensure that login terminates cleanly. +KillSignal=SIGHUP diff --git a/units/systemd-auto-console-getty.service.in b/units/systemd-auto-console-getty.service.in deleted file mode 100644 index 6542cab18a..0000000000 --- a/units/systemd-auto-console-getty.service.in +++ /dev/null @@ -1,16 +0,0 @@ -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. - -[Unit] -Description=Automatically Spawn getty on Kernel Console - -[Service] -Type=oneshot -ExecStart=@rootlibexecdir@/systemd-auto-console-getty - -[Install] -WantedBy=getty.target diff --git a/units/systemd-auto-serial-getty.service b/units/systemd-auto-serial-getty.service new file mode 100644 index 0000000000..8051c7446a --- /dev/null +++ b/units/systemd-auto-serial-getty.service @@ -0,0 +1,16 @@ +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. + +[Unit] +Description=Automatically Spawn getty on Serial Kernel Console + +[Service] +Type=oneshot +ExecStart=@rootlibexecdir@/systemd-auto-serial-getty + +[Install] +WantedBy=getty.target -- cgit v1.2.3-54-g00ecf