Re: force-reload/restart

Tobias Burnus <[email protected]>
Newsgroups gmane.linux.lsb.discuss
Message-ID <[email protected]>
Hi,

On Sat, 9 Aug 2003, Thorsten Kukuk wrote:
> currently we define "force-reload" as "cause the configuration to be
> reloaded if the service supports this, otherwise restart the service".
> And we define "restart" as "stop and restart the service if the
> service is already running, otherwise start the service".
>
> The result is: If a service supports SIGHUP and is not running, a
> "force-reload" will give you an error. If a service does not support
> SIGHUP, a "force-reload" will start the service, if it is not running
> before.

And there is in addition [as a slight contradiction]:
"If the service is not running the reload and the force-reload commands
 should not start the service."

(Note the "should" opposed to a "must".)

> So I suggest do change "force-reload" to:
> "cause the configuration to be reloaded if the service supports this,
> otherwise restart the service if it is running".

I'm fine with this.

Any objections to this patch which requires that force-reload doesn't
start a not-running servce?

Questions:
- Should the sentence
  "If the service is not running the reload and the force-reload commands
   must not start the service."
  be present as clarification of reload? Or is this obvious?
  (current patch drops the cited sentence with "should")

- Is the exit status code clear for force-reload if the service is not
  running? Given the discussion concerning "try-restart" it might not be
  the case. The attached patch adds
  "- running "reload" on a service already stopped or not running",
  "- running "force-reload" on a service already stopped or not running"
  to the list of actions which shall be considered successful.

Tobias
initactions.sgml.diff (text/plain, 1.6 KB)
Index: initactions.sgml
===================================================================
RCS file: /cvsroot/lsb/lsbspec/gLSB/sysinit/initactions.sgml,v
retrieving revision 1.8
diff -u -r1.8 initactions.sgml
--- initactions.sgml	8 Aug 2003 20:04:20 -0000	1.8
+++ initactions.sgml	12 Aug 2003 11:11:10 -0000
@@ -14,14 +14,14 @@
 <MEMBER>reload</MEMBER><MEMBER>cause the configuration of the service to be
 reloaded without actually stopping and restarting the service</MEMBER>
 <MEMBER>force-reload</MEMBER><MEMBER>cause the configuration to be reloaded
-if the service supports this, otherwise restart the service</MEMBER>
+if the service supports this, otherwise restart the service if it is
+running</MEMBER>
 <MEMBER>status</MEMBER><MEMBER>print the current status of the service</MEMBER>
 </SIMPLELIST>
 <PARA>
 The start, stop, restart, force-reload, and status commands must be supported
 by all init files; the reload and the try-restart options are optional. Other
-init script actions may be defined by the init script.  If the service is not
-running the reload and the force-reload commands should not start the service.
+init script actions may be defined by the init script.
 </PARA>
 <PARA>
 Init files must ensure that they will behave sensibly if invoked
@@ -89,6 +89,12 @@
 </PARA></LISTITEM>
 <LISTITEM><PARA>
 running "try-restart" on a service already stopped or not running
+</PARA></LISTITEM>
+<LISTITEM><PARA>
+running "reload" on a service already stopped or not running
+</PARA></LISTITEM>
+<LISTITEM><PARA>
+running "force-reload" on a service already stopped or not running
 </PARA></LISTITEM>
 </ITEMIZEDLIST>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.