systemd unit: use StandardInput=null to work in serial console mode
authorMichael Prokop <mika@grml.org>
Fri, 2 Sep 2022 15:02:07 +0000 (17:02 +0200)
committerMichael Prokop <mika@grml.org>
Fri, 2 Sep 2022 15:15:35 +0000 (17:15 +0200)
We shouldn't need standard input connected to a TTY, but when booting
in serial console mode (like `console=tty1 console=ttyS0,9600n8`), then
grml-autoconfig service fails with:

| systemd[1]: Starting Grml boot option support...
| systemd[1]: grml-autoconfig.service: Main process exited, code=exited, status=1/FAILURE
| systemd[1]: grml-autoconfig.service: Failed with result 'exit-code'.
| systemd[1]: Failed to start Grml boot option support.
| systemd[1]: grml-autoconfig.service: Consumed 2.475s CPU time.

Replacing `StandardInput=tty` with `StandardInput=null` fixes
this, while non-serial console mode seems to continue working fine.

Closes: https://github.com/grml/grml/issues/176

systemd/grml-autoconfig.service

index c2a1c99..c026713 100644 (file)
@@ -8,7 +8,7 @@ After=rc-local.service
 [Service]
 ExecStart=/etc/init.d/grml-autoconfig
 Type=oneshot
-StandardInput=tty
+StandardInput=null
 StandardOutput=tty
 
 [Install]