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

Re: Init Script for Arbitrary Number of Daemons

My problem is really starting an arbitrary number...

Perhaps I am guilty of some abuse of language; sorry. There is only one daemon, which I am trying to start an arbitrary number of copies of, with an arbitrary number of - possibly - different options. I'd like to be able to do something like:

	echo -n " $NAME"
	start-stop-daemon --start --quiet --pidfile /var/run/$NAME.$i.pid \
		--exec $DAEMON -- $DAEMON_OPTS

In the init script.

However, I don't know how to describe something like "$DAEMON_OPTS_LIST" in an "/etc/default" script fragment. Also, I don't know if there's already a nice, "Debian" way to start an arbitrary number of daemons.

Thanks again!


On May 11, 2004, at 7:28 PM, Stephen Gran wrote:

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

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


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

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

Reply to: