[streaming] Re: startup vls on debian
Benjamin PRACHT
bigben at via.ecp.fr
Fri Apr 9 13:06:42 CEST 2004
A very ugly script could be that :
It will launch vls under the "prod" user, which has UID 1000, and a miniSAPserver
This could be improved in many ways (for instance, the killall -9 vls is VERY dirty, and should be remplaced by a "start-stop-demaon" command line
#! /bin/sh
# Script de démarrage des services VLS & sapserver de videolan
set -e
#test $UID == 0 || test $UID == 1000 || echo "Denied" && exit 1
SAPSERVER_PATH=/home/prod/miniSAPserver
VLS_PATH=/home/prod/vls
case "$1" in
start)
echo -n "Starting miniSAPserver:"
if [ -x $SAPSERVER_PATH/sapserver ]
then
if [ $UID == 0 ]
then
su prod -c "$SAPSERVER_PATH/sapserver -c ~/sap.cfg -d"
elif [ $UID == 1000 ]
then
$SAPSERVER_PATH/sapserver -c ~/sap.cfg -d
fi
echo "Done"
else
echo "Not found."
fi
echo -n "Starting VLS:"
if [ -x $VLS_PATH/bin/vls ]
then
if [ $UID == 0 ]
then
cd $VLS_PATH/bin
su prod -c "screen -d -m -S vls ./vls -vvv -f ~/vls.cfg"
elif [ $UID == 1000 ]
then
cd $VLS_PATH/bin
screen -d -m -S vls ./vls -vvv -f ~/vls.cfg
fi
echo "Done"
else
echo "Not found."
fi
;;
stop)
echo -n "Stopping miniSAPserver:"
killall -9 sapserver > /dev/null || true
echo "Done"
echo -n "Stopping VLS:"
killall -9 vls > /dev/null || true
echo "Done"
;;
restart)
$0 stop
$0 start
;;
*) echo "Usage: /etc/init.d/videolan {start|stop|restart}"
;;
esac
--
$(echo "BigBen")
Oui je quote, et alors ?
--
This is the streaming mailing-list, see http://www.videolan.org/streaming/
To unsubscribe, please read http://www.videolan.org/support/lists.html
If you are in trouble, please contact <postmaster at videolan.org>
More information about the streaming
mailing list