When functions provided by /etc/rc.d/functions is used, escape
sequence is output under systemd service units and logged into
/var/log/messages as follows:
This is a regression issue caused by the commit f88dbd98e992 where
consoletype command was dropped.
Under systemd service units, standard input is associated with
/dev/null by default:
# systemctl show -p StandardInput foobar.service
StandardInput=null
man 5 systemd.exec:
StandardInput=
Controls where file descriptor 0 (STDIN) of the executed
processes is connected to. Takes one of null, tty,
tty-force, tty-fail, data, file:path, socket or fd:name.
If null is selected, standard input will be connected to
/dev/null, i.e. all read attempts by the process will
result in immediate EOF.
consoletype command interprets /dev/null as serial:
# consoletype < /dev/null
warning: consoletype is now deprecated, and will be removed in the near future!
warning: use tty (1) instead! More info: 'man 1 tty'
serial
The commit f88dbd98e992 overlooks this situation.
To fix this issue, check also "not a tty" to cover the case where
standard input is /dev/null.
Note that LANG=C is needed because the message "not a tty" varies
depending on locales.
…e units
When functions provided by /etc/rc.d/functions is used, escape sequence is output under systemd service units and logged into /var/log/messages as follows:
This is a regression issue caused by the commit f88dbd98e992 where consoletype command was dropped.
Under systemd service units, standard input is associated with /dev/null by default:
man 5 systemd.exec:
consoletype command interprets /dev/null as serial:
The commit f88dbd98e992 overlooks this situation.
To fix this issue, check also "not a tty" to cover the case where standard input is /dev/null.
Note that LANG=C is needed because the message "not a tty" varies depending on locales.