In order to test my SSL configuration, I thought it would be a good idea
to run two instances of the Icecast server daemon--the one running our
production environment, and a second one that no one would access but
me. I copied the daemon file /usr/bin/icecast2 to icecast2-test, and did
the same with the startup file in /etc/init.d after editing it to change
the value of $DAEMON, $DESC and $CONFIGFILE to point to the copy
mentioned above and the configuration containing the SSL stuff. I also
copied the small webroot directory from /usr/share/icecast2 to
/usr/share/icecast2-test. The configuration file is a copy of the
production file with these important changes:
• The ssl and ssl-certificate lines were added in their appropriate stanzas.
• webroot was changed to point to the test location (see above).
• All port numbers were change from 800x to 700x.
• I meticulously checked all file ownerships and permissions, and to the
best of my knowledge and ability, they're all correct.
However, when I try to start the second copy with:
./etc/init.d/icecast2-test start
I get the message that the daemon is "Detaching from the console...",
and then it's just plain gone. 'ps -ef|grep icecast' shows only the
production server process is running. There are no messages in
/var/log/yslog, and access.log and error.log in the test webroot never
get created, nor are there any messages in the production copies of
these files. Something's happening to cause the process to abbend or
otherwise exit prematurely, but I have no idea how to figure out what it is.
Just for kicks and grins, here's /etc/init.d/icecast2-test without the
comment lines at the top:
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/icecast2-test
NAME=icecast2-test
DESC=icecast2-test
test -x $DAEMON || exit 0
# Defaults
CONFIGFILE="/etc/icecast2/icecast-test.xml"
CONFIGDEFAULTFILE="/etc/default/icecast2"
USERID=icecast2
GROUPID=icecast
ENABLE="false"
# Reads config file (will override defaults above)
[ -r "$CONFIGDEFAULTFILE" ] && . $CONFIGDEFAULTFILE
if [ "$ENABLE" != "true" ]; then
echo "$NAME daemon disabled - read $CONFIGDEFAULTFILE."
exit 0
fi
set -e
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \
--exec $DAEMON -- -b -c $CONFIGFILE
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
# Send TERM after 5 seconds, wait at most 30 seconds.
start-stop-daemon --stop --oknodo --retry TERM/5/0/30 --quiet
--exec $DAEMON
echo "$NAME."
;;
reload|force-reload)
echo "Reloading $DESC configuration files."
start-stop-daemon --stop --signal 1 --quiet --exec $DAEMON
;;
restart)
echo -n "Restarting $DESC: "
# Send TERM after 5 seconds, wait at most 30 seconds.
start-stop-daemon --stop --oknodo --retry TERM/5/0/30 --quiet
--exec $DAEMON
start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \
--exec $DAEMON -- -b -c $CONFIGFILE
echo "$NAME."
;;
*)
echo "Usage: $0 {start|stop|restart|reload|force-reload}"
>&2
exit 1
;;
esac
exit 0
I suspect I'm missing something very obvious. Any and all assistance
greatly appreciated as always.
TIA