On Mon, 2006-06-12 at 15:54 +0200, Philipp Kern wrote: > Sorry, but I do not think that this fixes the problem the original > submitter stated. `init.d' should iterate over all configuration files > found in `/etc/bopm' and start separate BOPM instances, by passing the > file as an argument to BOPM's `-c' option. The fix you provided in > 3.1.2-7 just allows one to use a different configuration file, by > setting one in the OPTIONS variable in `/etc/default/bopm', not to use > multiple instances.
A proof of concept for such a configuration file handling (not developed
against 3.1.2-7, thus no patch) is outlined below:
`/etc/init.d/bopm' needs to be modified to iterate over the available
configuration files in `/etc/bopm'. BOPM already supports the concept of
CONFNAMEs, which specifies distinct configuration files in its directory
by looking for CONFNAME + '.conf'. This also sets the default logfile to
LOGDIR + CONFNAME + '.log'.
The following shell function could be used as a helper to retrieve a
CONFNAME from the name of the configuration file:
get_confname() {
CONFNAME=$(echo $1|sed -e 's#.*/\([a-zA-Z0-9]*\)\.conf$#\1#')
}
The user is expected to set the pidfile option correctly in the
additional configuration files. This should be noted in README.Debian.
[...]
start)
echo -n "Starting $DESC: $NAME"
for i in /etc/bopm/*.conf; do
get_confname $i
start-stop-daemon --start --quiet -c irc \
--pidfile /var/run/bopm/$CONFNAME.pid \
-b -o --exec $DAEMON -- -c $CONFNAME
echo -n "."
done
echo "."
;;
stop)
echo -n "Stopping $DESC: $NAME"
for i in /etc/bopm/*.conf; do
get_confname $i
start-stop-daemon --oknodo --stop --quiet \
--pidfile /var/run/bopm/$CONFNAME.pid --exec $DAEMON
echo -n "."
done
echo "."
;;
[...]
More changes are required for reload; restart could be aliased to stop,
start. Using a parameter set as introduced in your last revision does
not make sense because BOPM only supports two parameters:
-c -- Set the confname
-d -- Log to stderr, with increased verbosity
I hope that this proof of concept helps a bit.
Kind regards,
Philipp Kern
signature.asc
Description: This is a digitally signed message part

