s6-linux-init: rc.shutdown's and rc.shutdown.final's messages

From: Guillermo <gdiazhartusch_at_gmail.com>
Date: Sun, 24 Nov 2019 16:51:03 -0300

Hello,

Currently, s6-linux-init-shutdownd executes these files with their
standard output and error redirected to the catch-all logger's FIFO.
The daemon itself redirects its own to /dev/console only before
creating the stage 4 script. So, in the absence of errors, only the
"sending all processes the TERM signal..." and "sending all processes
the KILL signal..." messages are seen on the console.

However, in most circumstances I can think of, messages from
rc.shutdown and rc.shutdown.final, or error messages from commands in
the stage 4 script, will never be seen by the user, because the
machine is in the process of shutting down, and /run/uncaught-logs is
on a tmpfs, so it vanishes when the process completes. Therefore, this
is kind of like having stdout and stderr redirected to /dev/null.
Wouldn't it be better if s6-linux-init-shutdownd ran both rc.shutdown
and the entire stage 4 script with stdout and stderr redirected to
/dev/console instead? Except maybe in the case of receiving the 'S'
command on the control FIFO?

Alternatively, one could use the catch-all logger variant that echoes
logged messages to /dev/console (created by s6-linux-init-maker's '-1'
option), or perform redirections directly in rc.shutdown and
rc.shutdown.final. The first alternative, however, affects logging for
all processes. If the latter alternative is the preferred way, then I
think the example rc.* scripts installed in the skeldir
(/etc/s6-linux-init/skel by default) could contain commented stdout
and stderr redirections and an accompanying explanation, to make
readers aware that they might be needed.

Thanks,
G.
Received on Sun Nov 24 2019 - 19:51:03 UTC

This archive was generated by hypermail 2.3.0 : Sun May 09 2021 - 19:38:49 UTC