From: Jason Yundt Date: Tue, 17 Sep 2024 18:00:26 +0000 (-0400) Subject: man: document ShowStatus and SetShowStatus() X-Git-Tag: v257-rc1~410 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dfb3155419c5c1bfb9cd2c8735b46c7724d171c4;p=thirdparty%2Fsystemd.git man: document ShowStatus and SetShowStatus() SetShowStatus() was added in order to fix #11447. Recently, I ran into the exact same problem that OP was experiencing in #11447. I wasn’t able to figure out how to deal with the problem until I found #11447, and it took me a while to find #11447. This commit takes what I learned from reading #11447 and adds it to the documentation. Hopefully, this will make it easier for other people who run into the same problem in the future. --- diff --git a/man/org.freedesktop.systemd1.xml b/man/org.freedesktop.systemd1.xml index 373354050ae..aa4f69deb19 100644 --- a/man/org.freedesktop.systemd1.xml +++ b/man/org.freedesktop.systemd1.xml @@ -593,8 +593,6 @@ node /org/freedesktop/systemd1 { - - @@ -673,8 +671,6 @@ node /org/freedesktop/systemd1 { - - @@ -1362,6 +1358,24 @@ node /org/freedesktop/systemd1 { ResetFailedUnit() resets the "failed" state of a specific unit. + SetShowStatus() configures the display of status messages during bootup and + shutdown. The mode parameter can be set to any value that's valid for the + systemd.show_status kernel parameter. For more information about + systemd.show_status, see + systemd1. + The mode parameter can also be set to an empty string. When mode + is set to an empty string, SetShowStatus() will reset + ShowStatus back to its original value. You can use + SetShowStatus() create a service that does something like this: + + Send a D-Bus message that will turn off status messages. + Block until a reply to that message is received. + Print multiples lines without being interrupted by status messages. + Send a D-Bus message that will reset ShowStatus back to its + original value. + + + ResetFailed() resets the "failed" state of all units. ListUnits() returns an array of all currently loaded units. Note that @@ -1788,6 +1802,12 @@ node /org/freedesktop/systemd1 { Environment encodes the environment block passed to all executed services. It may be altered with bus calls such as SetEnvironment() (see above). + ShowStatus encodes systemd's current policy for displaying status messages + during bootup and shutdown. Its value can be any valid value for the + systemd.show_status kernel parameter (see + systemd1). + It may be altered using SetShowStatus() (see above). + UnitPath encodes the currently active unit file search path. It is an array of file system paths encoded as strings. diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml index 2ff49ff8541..c8ca543b457 100644 --- a/man/systemd.exec.xml +++ b/man/systemd.exec.xml @@ -3001,7 +3001,12 @@ SystemCallErrorNumber=EPERM connects standard output to a tty (as configured via TTYPath=, see below). If the TTY is used for output only, the executed process will not become the controlling process of - the terminal, and will not fail or wait for other processes to release the terminal. + the terminal, and will not fail or wait for other processes to release the terminal. Note: if a unit + tries to print multiple lines to a TTY during bootup or shutdown, then there's a chance that those + lines will be broken up by status messages. SetShowStatus() can be used to + prevent this problem. See + org.freedesktop.systemd15 + for details. connects standard output with the journal, which is accessible via journalctl1. Note diff --git a/man/systemd.xml b/man/systemd.xml index ddd190093eb..af1681352e8 100644 --- a/man/systemd.xml +++ b/man/systemd.xml @@ -568,7 +568,11 @@ Enables display of status messages on the console, as controlled via systemd.show_status=1 on the kernel command - line. + line. + You may want to use SetShowStatus() instead of + SIGRTMIN+20 in order to prevent race conditions. See + org.freedesktop.systemd15. + @@ -579,7 +583,11 @@ controlled via systemd.show_status=0 on the kernel command - line. + line. + You may want to use SetShowStatus() instead of + SIGRTMIN+21 in order to prevent race conditions. See + org.freedesktop.systemd15. +