]> git.ipfire.org Git - thirdparty/systemd.git/commit
core: systemd-shutdown: avoid confusingly redundant messages 7142/head
authorAlan Jenkins <alan.christopher.jenkins@gmail.com>
Thu, 19 Oct 2017 14:02:12 +0000 (15:02 +0100)
committerAlan Jenkins <alan.christopher.jenkins@gmail.com>
Tue, 24 Oct 2017 14:54:30 +0000 (15:54 +0100)
commit116e6d964380213bb52b49d5404c3b9280911e17
treeb0181dcbb5cdc57956197c8d3eb3fb50e3e6fda6
parent066b753dc5fefd0bfef92e28d3492667e2ffe22b
core: systemd-shutdown: avoid confusingly redundant messages

After previous output from systemd-shutdown indicated a bug, my attention
was drawn to redundant output lines.  Did they indicate an anomaly?

It turns out to be an expected, harmless result of the current code.  But
we don't have much justification to run such redundant operations.  Let's
remove the confusing redundant message.

We can stop trying to remount a directory read-only once its mount entry
has successfully been changed to "ro".  We can simply let the kernel keep
track of this for us.  I don't bother to try and avoid re-parsing the
mountinfo.  I appreciate snappy shutdowns, but this code is already
intricate and buggy enough (see issue 7131).

(Disclaimer: At least for the moment, you can't _rely_ on always seeing
suspicious output from systemd-shutdown.  By default, you can expect the
kernel to truncate the log output of systemd-shutdown.  Ick ick ick!
Because /dev/kmsg is rate-limited by default.  Normally it prints a message
"X lines supressed", but we tend to shut down before the timer expires
in this case).

Before:

systemd-shutdown[1]: Remounting '/' read-only with options 'seclabel...
EXT4-fs (vda3): re-mounted. Opts: data=ordered
systemd-shutdown[1]: Remounting '/' read-only with options 'seclabel, ...
EXT4-fs (vda3): re-mounted. Opts: data=ordered

After:

systemd-shutdown[1]: Remounting '/' read-only with options 'seclabel, ...
EXT4-fs (vda3): re-mounted. Opts: data=ordered

I also tested with `systemctl reboot --force`, plus a loopback mount to
cause one of the umounts to fail initially.  In this case another 2 lines
of output are removed (out of a larger number of lines).
src/core/umount.c