Merge pull request #7338 from poettering/doc-restart-fix

improve unit restart documentation a bit
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2017-11-17 14:51:51 +01:00
committed by GitHub
3 changed files with 28 additions and 19 deletions

4
TODO
View File

@@ -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

View File

@@ -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
<term><command>restart <replaceable>PATTERN</replaceable></command></term>
<listitem>
<para>Stop and then start one or more units specified on the
command line. If the units are not running yet, they will
be started.</para>
<para>Stop and then start one or more units specified on the command line. If the units are not running
yet, they will be started.</para>
<para>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
<varname>FileDescriptoreStoreMax=</varname> in
<citerefentry><refentrytitle>systemd.service</refentrytitle><manvolnum>5</manvolnum></citerefentry>) 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 <command>systemctl stop</command> command followed by <command>systemctl
start</command> should be issued.</para>
</listitem>
</varlistentry>
<varlistentry>
@@ -797,18 +805,16 @@ Sun 2017-02-26 20:57:49 EST 2h 3min left Sun 2017-02-26 11:56:36 EST 6h ago
<term><command>reload-or-restart <replaceable>PATTERN</replaceable></command></term>
<listitem>
<para>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.</para>
<para>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.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><command>try-reload-or-restart <replaceable>PATTERN</replaceable></command></term>
<listitem>
<para>Reload one or more units if they support it. If not,
restart them instead. This does nothing if the units are not
running.</para>
<para>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.</para>
<!-- Note that we don't document force-reload here, as that is just compatibility support, and we generally
don't document that. -->
</listitem>
@@ -1027,14 +1033,11 @@ Jan 12 10:46:45 example.com bluetoothd[8900]: gatt-time-server: Input/output err
<term><command>reset-failed [<replaceable>PATTERN</replaceable>…]</command></term>
<listitem>
<para>Reset the <literal>failed</literal> 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
<literal>failed</literal> state and its exit code and status
is recorded for introspection by the administrator until the
service is restarted or reset with this command.</para>
<para>Reset the <literal>failed</literal> 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 <literal>failed</literal> 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.</para>
</listitem>
</varlistentry>

View File

@@ -352,7 +352,7 @@
<literal>+</literal>/<literal>!</literal>/<literal>!!</literal> may be used together and they can appear in any
order. However, only one of <literal>+</literal>, <literal>!</literal>, <literal>!!</literal> may be used at a
time. Note that these prefixes are also supported for the other command line settings,
i.e. <varname>ExecStartPre=</varname>, <varname>ExecStartPost=</varname>, <varname>ExecReload</varname>,
i.e. <varname>ExecStartPre=</varname>, <varname>ExecStartPost=</varname>, <varname>ExecReload=</varname>,
<varname>ExecStop=</varname> and <varname>ExecStopPost=</varname>.</para>
<para>If more than one command is specified, the commands are
@@ -461,7 +461,9 @@
start-up failed, for example because any of the commands specified in <varname>ExecStart=</varname>,
<varname>ExecStartPre=</varname> or <varname>ExecStartPost=</varname> failed (and weren't prefixed with
<literal>-</literal>, see above) or timed out. Use <varname>ExecStopPost=</varname> to invoke commands when a
service failed to start up correctly and is shut down again.</para>
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 <varname>ExecStop=</varname> and
<varname>ExecStopPost=</varname> are executed during a service restart operation.</para>
<para>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