[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Init Script for Arbitrary Number of Daemons



This one time, at band camp, ms419@freezone.co.uk said:
> The "skeleton" "init.d" file is a great default for starting _one_ 
> daemon, complete with the "$DAEMON_OPTS" variable. It's not clear, 
> however, what this newbie package developer should do to start an 
> arbitrary number of daemons, each with - potentially - different 
> "$DAEMON_OPTS".
> 
> It's nice to be able to throw "$DAEMON_OPTS" into 
> "/etc/default/package" and get get a bit more control over the daemon; 
> but I can't think how to nicely specify an arbitrary number of 
> "$DAEMON_OPTS" variables in a "/etc/default/package" script fragment.
> 
> I'm still searching for a solution... Input much appreciated!

I am not exactly sure what you mean by arbitrary - I'm assumin you have
a real number in mind, but that it could vary (e.g., some may not be
selected to actually run at boot, or all could, depending on the setup).
If the daemons are useful independently of each other, package them
seperately.  If not, try one of the following.

You can use multiple init scripts, or you can take a look at the init
scripts of packages that start multiple daemons (slapd and samba come to
mind) for examples of how others do it.  

If you just want seperate defaults, seperate lines in
/etc/default/package would work well - it's just sourced, so 
DAEMON_1_OPTS="..."
DAEMON_2_OPTS="..."

etc.

If you really mean arbitrary, in the sense that you have no idea how
many, I can't help :)

HTH,
-- 
 -----------------------------------------------------------------
|   ,''`.					     Stephen Gran |
|  : :' :					 sgran@debian.org |
|  `. `'			Debian user, admin, and developer |
|    `-					    http://www.debian.org |
 -----------------------------------------------------------------

Attachment: pgpSMbzAfXsrI.pgp
Description: PGP signature


Reply to: