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:

---
for DAEMON_OPTS in $DAEMON_OPTS_LIST; do
        echo -n " $NAME"
        start-stop-daemon --start --quiet --pidfile /var/run/$NAME.$i.pid \
                --exec $DAEMON -- $DAEMON_OPTS
done
---

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!

Jack

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

This one time, at band camp, [EMAIL PROTECTED] 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 |
|  : :' :                                        [EMAIL PROTECTED] |
|  `. `'                        Debian user, admin, and developer |
|    `-                                     http://www.debian.org |
 -----------------------------------------------------------------

Reply via email to