[prev in list] [next in list] [prev in thread] [next in thread] 

List:       osdl-lsb-discuss
Subject:    [lsb-discuss] Patch?: Init script "[force-]reload" behaviour
From:       tobias.burnus () physik ! fu-berlin ! de (Tobias Burnus)
Date:       2003-07-08 15:56:24
Message-ID: Pine.LNX.4.44.0307081736090.488-200000 () g25 ! physik ! fu-berlin ! de
[Download RAW message or body]

Hi,


*** This is a request for comments! ***



this is an attempt to fix this issue:
  [ 568246 ] Init action: [force-]reload and stopped service
http://sourceforge.net/tracker/index.php?func=detail&aid=568246&group_id=1107&atid=101107


The problem is that
   ./lsb-init-script force-reload
and
   ./lsb-init-script reload
show an undetermined behaviour if the service is not running.


Using start and restart one knows that the service is running afterwards.
Using try-restart one knows that it only runs if it was running.


For reload one might assume that it either does nothing (e.g. for cron
which checks the files itself or if a SIGHUP is not possible) or sends
SIGHUP, but there are actually implementations which restart or,
SIGHUP (if running) and start (if not).

I think no service should be started in this case!


For force-reload the situation is worse: It is either reload (= usually no
start of non-running programs) or restart (always run it).

I propose to use reload or try-restart, i.e. don't start the program if it
is not running.


If the program should be running at the end _and_ a SIGHUP should be used
in favour of a restart (as it makes sense for autofs),
   ./lsb-init-script reload || ./lsb-init-script restart
can be used.


Tobias



PS: I used "should" (a 'behavior that is recommended programming
practice') and not "must" ('behavior that is mandatory for an
application or user') in order to give the implementors the flexibility;
especially since there is no "recommended programming practice" yet.

["init-2.diff" (TEXT/plain)]

Index: initactions.sgml
===================================================================
RCS file: /cvsroot/lsb/spec/wip/sysinit/initactions.sgml,v
retrieving revision 1.4
diff -u -r1.4 initactions.sgml
--- initactions.sgml	18 Jun 2003 16:11:12 -0000	1.4
+++ initactions.sgml	8 Jul 2003 15:35:54 -0000
@@ -20,7 +20,8 @@
 <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.
+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.
 </PARA>
 <PARA>
 Init files must ensure that they will behave sensibly if invoked


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic