PDA

View Full Version : SlimServer 6.0 on FreeBSD



=?ISO-8859-1?Q?Fran=E7ois_Rayer?=
2005-04-01, 01:26
Hello,

This is my start/stop script on FreeBSD 5.3, slimserver 6 release

The slimserver is handled by a user&group called "slimservd", and I do
manage where I want the .slimserver.pref and slimserver.log to be.

Works smoothly

By the way, as in the script, the language is French overhere :)


François

------------------------------------------------------------------------
--------
#! /bin/sh
#
## /usr/local/etc/rc.d/slimserver.sh : start and stop slimserver
#

SLIMSERVER_USER="slimservd"
SLIMSERVER_GROUP="slimservd"
SLIMSERVER_PREF="/home/slimservd/.slimserver.pref"
SLIMSERVER_LOG="/var/log/slimserver.log"
SLIMSERVER_CACHEDIR="/home/slimservd/"

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=slimserver

SLIMSERVER_ARGS="--daemon --pidfile=/var/run/$NAME.pid
--prefsfile=$SLIMSERVER_PREF --logfile=$SLIMSERVER_LOG
--user=$SLIMSERVER_USER --group=$SLIMSERVER_GROUP
--cachedir=$SLIMSERVER_CACHEDIR"

case "$1" in

start)
echo -n "Starting SlimServer"
LANG=fr_FR.ISO8859-1
export LANG
/usr/local/slimserver/$NAME.pl $SLIMSERVER_ARGS
echo "."
;;

stop)
echo -n "Stopping SlimServer"
# kill the process with this pid
kill -9 `cat /var/run/$NAME.pid` > /dev/null
rm /var/run/$NAME.pid
echo "."
;;

*)
echo "Usage: /usr/local/etc/rc.d/$NAME.sh start|stop" >&2
;;
esac

exit 0
------------------------------------------------------------------------
--------