In the end I just used this and it worked quite nicely:
#!/bin/sh
#
# $Id$
#
# MusicMagicServer startup script
# This file should be placed in /etc/init.d.
#
# A cruel distortion of the work of Mattias Holmlund and Dan Scully
#
# Updated By: Russell Craig
set -e
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DESC="Predixis MusicMagic Server"
NAME=MusicMagicServer
# insert the desired user name as MMMUSER
MMMUSER=russ
export MUSICHOME=/home/$MMMUSER/Predixis/MusicMagicMixer/
DAEMON=$MUSICHOME$NAME
SCRIPTNAME=/etc/init.d/$NAME
# Read config file if it is present.
if [ -r /etc/default/$NAME ]
then
. /etc/default/$NAME
fi
#
# Function that starts the daemon/service.
#
d_start() {
su - $MMMUSER -c $DAEMON" start & >/dev/null"
}
# Function that stops the daemon/service.
#
d_stop() {
su - $MMMUSER -c $DAEMON" stop & >/dev/null"
}
case "$1" in
start)
echo -n "Starting $DESC"
d_start
echo "."
;;
stop)
echo -n "Stopping $DESC"
d_stop
echo "."
;;
*)
# echo "Usage: $SCRIPTNAME {start|stop}" >&2
echo "Usage: $SCRIPTNAME {start|stop}" >&2
exit 1
;;
esac
exit 0
--
fairyliquidizer
"O wad some Power the giftie gie us
To see oursels as ithers see us!
It wad frae monie a blunder free us,
An' foolish notion."
-Robert Burns-
------------------------------------------------------------------------
fairyliquidizer's Profile: http://forums.slimdevices.com/member.php?userid=3678
View this thread: http://forums.slimdevices.com/showthread.php?t=21710
_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/unix