The manpage says condrestart is equivalent to reload-or-try-restart, but the code and the sysvinitscripts file from the initscripts package says it is actually the same as try-restart.
Further, the code and manpage say that force-reload is equivalent to reload-or-try-restart, but several legacy init scripts and the Debian Policy Manual (9.3.2), not to mention the name itself, suggest that it should be the same as the reload-or-restart command. There are also some spelling corrections.
From 696db0b37560b53c615df3b1c6c3c5ba991dfcb3 Mon Sep 17 00:00:00 2001 From: Ran Benita <ran...@gmail.com> Date: Fri, 26 Nov 2010 22:05:22 +0200 Subject: [PATCH] man, systemctl: correct handling of compatibility commands The manpage says condrestart is equivalent to reload-or-try-restart, but the code and the sysvinitscripts file from the initscripts package says it is actually the same as try-restart. Further, the code and manpage say that force-reload is equivalent to reload-or-try-restart, but several legacy init scripts and the Debian Policy Manual (9.3.2), not to mention the name itself, suggest that it should be the same as the reload-or-restart command. There are also some spelling corrections. --- man/systemctl.xml | 55 ++++++++++++++++++++------------------ src/systemctl-bash-completion.sh | 4 +- src/systemctl.c | 6 ++-- 3 files changed, 34 insertions(+), 31 deletions(-) diff --git a/man/systemctl.xml b/man/systemctl.xml index 844d218..06d1ace 100644 --- a/man/systemctl.xml +++ b/man/systemctl.xml @@ -154,7 +154,7 @@ <listitem><para>Suppress output to STDOUT in <command>snapshot</command>, - <command>check</command>, + <command>is-active</command>, <command>enable</command> and <command>disable</command>.</para></listitem> </varlistentry> @@ -224,7 +224,7 @@ <listitem><para>When used with <command>enable</command> and <command>disable</command>, operate on the - global user configuĊation + global user configuration directory, thus enabling or disabling a unit file globally for all future logins of all users.</para></listitem> @@ -257,7 +257,7 @@ <command>systemctl</command> will query the user on the terminal for the necessary secrets. Use this option to - switch this behaviour off. In this + switch this behavior off. In this case the password must be supplied by some other means (for example graphical password agents) or the @@ -276,7 +276,7 @@ <option>process</option> to select whether to kill the entire control group, the process group or only the - selected process itself. If ommitted + selected process itself. If omitted defaults to <option>control-group</option> if <option>--kill-who=all</option> is @@ -296,22 +296,22 @@ <option>all</option> to select whether to kill only the main process of the unit, the control process or all - processes of the unit. If ommitted + processes of the unit. If omitted defaults to <option>all</option>.</para></listitem> </varlistentry> <varlistentry> - <term><option>---signal=</option></term> + <term><option>--signal=</option></term> <term><option>-s</option></term> <listitem><para>When used with <command>kill</command>, choose which signal to send to selected processes. Must be one of the well - know signal specifiers such as + known signal specifiers such as SIGTERM, SIGINT or SIGSTOP. If - ommitted defaults to + omitted defaults to <option>SIGTERM</option>.</para></listitem> </varlistentry> @@ -416,7 +416,11 @@ units specified on the command line. If the units are not running yet the operation will - fail.</para></listitem> + fail. Note that for compatibility with + SysV and Red Hat init scripts + <command>condrestart</command> may be + used as an equivalent command to + <command>try-restart</command>.</para></listitem> </varlistentry> <varlistentry> <term><command>reload-or-restart [NAME...]</command></term> @@ -427,10 +431,9 @@ restart them instead. Note that for compatibility with SysV and Red Hat init scripts - <command>force-reload</command> and - <command>condrestart</command> may be - used as equivalent commands to - <command>reload-or-try-restart</command>.</para></listitem> + <command>force-reload</command> may be + used as an equivalent command to + <command>reload-or-restart</command>.</para></listitem> </varlistentry> <varlistentry> <term><command>isolate [NAME]</command></term> @@ -469,7 +472,7 @@ <term><command>is-active [NAME...]</command></term> <listitem><para>Check whether any of - the specified units is active + the specified units are active (i.e. running). Returns an exit code 0 if at least one is active, non-zero otherwise. Unless @@ -569,7 +572,7 @@ administrator is free to make additional changes manually, by placing or removing symlinks in the - directory. This is particular useful + directory. This is particularly useful to create configurations that deviate from the suggested default installation. In this case the @@ -641,7 +644,7 @@ <option>--quiet</option>.</para> </listitem> - <para>This command honours + <para>This command honors <option>--system</option>, <option>--user</option>, <option>--global</option> in a similar @@ -700,7 +703,7 @@ <listitem><para>Cancel one or more jobs specified on the command line by their numeric job - IDs. If not job id is specified cancels all jobs that are pending.</para></listitem> + IDs. If no job id is specified, cancels all pending jobs.</para></listitem> </varlistentry> <varlistentry> <term><command>monitor</command></term> @@ -756,7 +759,7 @@ <para>A snapshot refers to a saved state of the systemd manager. It is - implemented itself as unit that is + implemented itself as a unit that is generated dynamically with this command and has dependencies on all units active at the time. At a later @@ -881,8 +884,8 @@ users. If combined with <option>--force</option> shutdown of all running services is - skipped, however all processes killed - and all file systems unmounted or + skipped, however all processes are killed + and all file systems are unmounted or mounted read-only, immediately followed by the system halt.</para></listitem> @@ -898,8 +901,8 @@ users. If combined with <option>--force</option> shutdown of all running services is - skipped, however all processes killed - and all file systems unmounted or + skipped, however all processes are killed + and all file systems are unmounted or mounted read-only, immediately followed by the powering off.</para></listitem> @@ -915,8 +918,8 @@ users. If combined with <option>--force</option> shutdown of all running services is - skipped, however all processes killed - and all file systems unmounted or + skipped, however all processes are killed + and all file systems are unmounted or mounted read-only, immediately followed by the reboot.</para></listitem> @@ -931,8 +934,8 @@ a wall message to all users. If combined with <option>--force</option> shutdown of all running services is - skipped, however all processes killed - and all file systems unmounted or + skipped, however all processes are killed + and all file systems are unmounted or mounted read-only, immediately followed by the reboot.</para></listitem> diff --git a/src/systemctl-bash-completion.sh b/src/systemctl-bash-completion.sh index 3e3380c..a54fa38 100644 --- a/src/systemctl-bash-completion.sh +++ b/src/systemctl-bash-completion.sh @@ -79,10 +79,10 @@ _systemctl () { local -A VERBS=( [ALL_UNITS]='enable disable is-active is-enabled status show' [FAILED_UNITS]='reset-failed' - [STARTABLE_UNITS]='start restart reload-or-restart' + [STARTABLE_UNITS]='start restart reload-or-restart force-reload' [STOPPABLE_UNITS]='stop kill try-restart condrestart' [ISOLATEBLE_UNITS]='isolate' - [RELOADABLE_UNITS]='reload reload-or-try-restart force-reload' + [RELOADABLE_UNITS]='reload reload-or-try-restart' [JOBS]='cancel' [SNAPSHOTS]='delete' [ENVS]='set-environment unset-environment' diff --git a/src/systemctl.c b/src/systemctl.c index 4768fb2..3ca18d1 100644 --- a/src/systemctl.c +++ b/src/systemctl.c @@ -1321,9 +1321,9 @@ static int start_unit(DBusConnection *bus, char **args, unsigned n) { streq(args[0], "restart") ? "RestartUnit" : streq(args[0], "try-restart") || streq(args[0], "condrestart") ? "TryRestartUnit" : - streq(args[0], "reload-or-restart") ? "ReloadOrRestartUnit" : - streq(args[0], "reload-or-try-restart") || - streq(args[0], "force-reload") ? "ReloadOrTryRestartUnit" : + streq(args[0], "reload-or-restart") || + streq(args[0], "force-reload") ? "ReloadOrRestartUnit" : + streq(args[0], "reload-or-try-restart") ? "ReloadOrTryRestartUnit" : "StartUnit"; mode = -- 1.7.3.2
_______________________________________________ systemd-devel mailing list systemd-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/systemd-devel