Proposed guideline for init script files

Ville Skyttä ville.skytta at iki.fi
Mon Mar 5 20:27:58 UTC 2007


On Monday 05 March 2007, Toshio Kuratomi wrote:
> On Mon, 2007-03-05 at 00:47 -0500, John T. Guthrie wrote:
> >
> > 2) That initscripts be discouraged from putting command-line arguments
> > directly in the scripts.  Instead they should be placed in the variable
> > from part 1) in /etc/sysconfig/progname.  Putting command-line arguments
> > directly into the init script means that I can't remove those arguments
> > without modifying the init script.  There could be some exceptions to
> > this guideline.  An example would be something to set the uid of the
> > program in question, such as adding "-u named" in the script to start
> > named.
>
> #2 isn't necessary as long as you can override an option
> through /etc/sysconfig/progname.  For instance, if the program allows
> options that come later on the commandline to override ones that come
> earlier and the PROGOPTS variable is the last thing on the commandline.

True, but there are cases where overriding certain options in the config file 
would be better off made explictly impossible.  For example various 
daemonization related options or lack of them may break the init script by 
making it never return from daemon(), and cases that should be prevented 
where feasible.




More information about the Fedora-maintainers mailing list