From c4f2aaa45b908972a5d0f817e4a3fdf4474b5765 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 15 Nov 2017 11:22:25 +0100 Subject: [PATCH 1/5] man: document the interaction of "systemctl restart" and the FD store See: #7126 --- man/systemctl.xml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/man/systemctl.xml b/man/systemctl.xml index bb3fc1763c..fb6bb0d702 100644 --- a/man/systemctl.xml +++ b/man/systemctl.xml @@ -777,9 +777,17 @@ Sun 2017-02-26 20:57:49 EST 2h 3min left Sun 2017-02-26 11:56:36 EST 6h ago restart PATTERN - Stop and then start one or more units specified on the - command line. If the units are not running yet, they will - be started. + Stop and then start one or more units specified on the command line. If the units are not running + yet, they will be started. + + Note that restarting a unit with this command does not necessarily flush out all of the unit's + resources before it is started again. For example, the per-service file descriptor storage facility (see + FileDescriptoreStoreMax= in + systemd.service5) will + remain intact as long as the unit has a job pending, and is only cleared when the unit is fully stopped and + no jobs are pending anymore. If it is intended that the file descriptor store is flushed out, too, during a + restart operation an explicit systemctl stop command followed by systemctl + start should be issued. From ff946d82434defa63fbd29eddce051309aa0394e Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 15 Nov 2017 11:23:00 +0100 Subject: [PATCH 2/5] man: write "stop and start" instead of "restart" when explaining the reload fallback operations We already made a similar change when talking about the "restart" command, let's also do this for "systemctl reload" and friends. Follow-up for: 6539dd7c42946d9ba5dc43028b8b5785eb2db3c5 See: #7126 --- man/systemctl.xml | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/man/systemctl.xml b/man/systemctl.xml index fb6bb0d702..f5df6065fa 100644 --- a/man/systemctl.xml +++ b/man/systemctl.xml @@ -805,18 +805,16 @@ Sun 2017-02-26 20:57:49 EST 2h 3min left Sun 2017-02-26 11:56:36 EST 6h ago reload-or-restart PATTERN - Reload one or more units if they support it. If not, - restart them instead. If the units are not running yet, they - will be started. + Reload one or more units if they support it. If not, stop and then start them instead. If the units + are not running yet, they will be started. try-reload-or-restart PATTERN - Reload one or more units if they support it. If not, - restart them instead. This does nothing if the units are not - running. + Reload one or more units if they support it. If not, stop and then start them instead. This does + nothing if the units are not running. @@ -1035,14 +1033,11 @@ Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output err reset-failed [PATTERN…] - Reset the failed state of the - specified units, or if no unit name is passed, reset the state of all - units. When a unit fails in some way (i.e. process exiting - with non-zero error code, terminating abnormally or timing - out), it will automatically enter the - failed state and its exit code and status - is recorded for introspection by the administrator until the - service is restarted or reset with this command. + Reset the failed state of the specified units, or if no unit name is passed, reset + the state of all units. When a unit fails in some way (i.e. process exiting with non-zero error code, + terminating abnormally or timing out), it will automatically enter the failed state and + its exit code and status is recorded for introspection by the administrator until the service is + stopped/re-started or reset with this command. From 78a263f432c7c7b9f5c2ab9df6c5f311f7debcb9 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 15 Nov 2017 11:24:51 +0100 Subject: [PATCH 3/5] man: add missing suffixing "=" for setting name --- man/systemd.service.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/man/systemd.service.xml b/man/systemd.service.xml index b99f7f9df8..03cd14ceff 100644 --- a/man/systemd.service.xml +++ b/man/systemd.service.xml @@ -352,7 +352,7 @@ +/!/!! may be used together and they can appear in any order. However, only one of +, !, !! may be used at a time. Note that these prefixes are also supported for the other command line settings, - i.e. ExecStartPre=, ExecStartPost=, ExecReload, + i.e. ExecStartPre=, ExecStartPost=, ExecReload=, ExecStop= and ExecStopPost=. If more than one command is specified, the commands are From 8adf53582c8b5ab486736e8f9541baf9853aa2de Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 15 Nov 2017 11:25:19 +0100 Subject: [PATCH 4/5] man: document that ExecStop= is executed during restarts Fixes: #7126 --- man/systemd.service.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/man/systemd.service.xml b/man/systemd.service.xml index 03cd14ceff..43c6435dcb 100644 --- a/man/systemd.service.xml +++ b/man/systemd.service.xml @@ -461,7 +461,9 @@ start-up failed, for example because any of the commands specified in ExecStart=, ExecStartPre= or ExecStartPost= failed (and weren't prefixed with -, see above) or timed out. Use ExecStopPost= to invoke commands when a - service failed to start up correctly and is shut down again. + service failed to start up correctly and is shut down again. Also note that, service restart requests are + implemented as stop operations followed by start operations. This means that ExecStop= and + ExecStopPost= are executed during a service restart operation. It is recommended to use this setting for commands that communicate with the service requesting clean termination. When the commands specified with this option are executed it should be assumed that the service is From 3d80d4541b8288956906e4bd1d062696babf50f4 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 15 Nov 2017 11:25:38 +0100 Subject: [PATCH 5/5] update TODO --- TODO | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/TODO b/TODO index 553575d087..d0d1430845 100644 --- a/TODO +++ b/TODO @@ -24,6 +24,10 @@ Janitorial Clean-ups: Features: +* add a new RuntimeDirectoryPreserve= mode that defines a similar lifecycle for + the runtime dir as we maintain for the fdstore: i.e. keep it around as long + as the unit is running or has a job queued. + * let's log the "tainted" string at boot * Add NetworkNamespacePath= to specify a path to a network namespace