mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-25 06:03:40 +03:00
Alan Jenkins
116e6d9643
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).
systemd - System and Service Manager
Details
General information about systemd can be found in the systemd Wiki.
Information about build requirements are provided in the README file.
Consult our NEWS file for information about what's new in the most recent systemd versions.
Please see the HACKING file for information how to hack on systemd and test your modifications.
Please see our Contribution Guidelines for more information about filing GitHub Issues and posting GitHub Pull Requests.
When preparing patches for systemd, please follow our Coding Style Guidelines.
If you are looking for support, please contact our mailing list or join our IRC channel.
Description
Languages
C
89.4%
Python
5.8%
Shell
2.1%
Meson
1.3%
HTML
0.9%
Other
0.4%