You know, now I look at it, I did do a couple of things. Perhaps there is Wiki fodder here, after all.
I created a file calle
/etc/default/coherence, and put this in it:
COHERENCE_OPTIONS="-c /etc/coherence.conf"
I also created an init script,
/etc/init.d/coherence, which looks like this:
#!/bin/sh -e
#
# Coherence init script
#
### BEGIN INIT INFO
# Provides: coherence
# Required-Start: $local_fs $syslog $network
# Should-Start:
# Required-Stop:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Coherence
# Description: Coherence DLNA/UPnP Framework
# You should edit configuration in /etc/coherence.conf file
# See
http://coherence.beebits.net for details
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/coherence
NAME=coherence
DESC="Coherence DLNA/UPnP Framework"
PIDFILE=/var/run/coherence.pid
CONFIGFILE=/etc/coherence.conf
# abort if no executable exists
[ -x $DAEMON ] || exit 0
# Get lsb functions
. /lib/lsb/init-functions
. /etc/default/rcS
[ -f /etc/default/coherence ] && . /etc/default/coherence
checkpid() {
[ -e $PIDFILE ] || touch $PIDFILE
}
case "$1" in
start)
log_daemon_msg "Starting $DESC: $NAME"
checkpid
start-stop-daemon --start --quiet --background --oknodo \
--make-pidfile --pidfile $PIDFILE \
--exec $DAEMON -- $COHERENCE_OPTIONS
log_end_msg $?
;;
stop)
log_daemon_msg "Stopping $DESC: $NAME"
start-stop-daemon --stop --signal 2 --quiet --oknodo --pidfile $PIDFILE
log_end_msg $?
;;
reload|force-reload)
log_daemon_msg "Reloading $DESC: $NAME"
start-stop-daemon --stop --signal 1 --quiet --oknodo --pidfile $PIDFILE --exec $DAEMON
log_end_msg $?
;;
restart)
$0 stop
$0 start
;;
*)
N=/etc/init.d/$NAME
log_success_msg "Usage: $N {start|stop|restart|reload|force-reload}"
exit 1
;;
esac
exit 0