[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Demexp-dev] Shell script to launch demexp server
From: |
David MENTRE |
Subject: |
[Demexp-dev] Shell script to launch demexp server |
Date: |
Sun, 07 May 2006 16:35:14 +0200 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux) |
Hello,
We are using following shell script to manage demexp daemon on the
officiel demexp server. It could be useful for demexp packagers. ;) The
script should be to put as /etc/init.d/demexp and be used by /etc/rc?.d/
directories. Can be used to start and stop demexp server.
#!/bin/sh
DEMEXP_BIN=/path/to/demexp-server.static
DEMEXP_OPTIONS=""
DEMEXP_LOG_DIR=/path/to/public-log-dir
DEMEXP_BASES_DIR=/path/to/bases-dir
DEMEXP_LISTEN_ADDRESS=localhost:50000
DEMEXP_USER=demexp
# don't execute this script if no binary
test -x $DEMEXP_BIN || exit 0
# where to put our logs?
log_filename=$DEMEXP_LOG_DIR/demexp-`date -Iseconds`
# where are our bases?
bases=$DEMEXP_BASES_DIR/bases.dmxp
pid_file=$DEMEXP_BASES_DIR/bases.pid
start() {
su $DEMEXP_USER --command="$DEMEXP_BIN $DEMEXP_OPTIONS \
--daemon --bases $bases --listen $DEMEXP_LISTEN_ADDRESS \
--logfile $log_filename.log 2> $log_filename.err" &
return $?
}
stop() {
kill -SIGQUIT `cat $pid_file`
return $?
}
case "$1" in
start)
echo -n "Starting demexp server:"
start
;;
stop)
echo -n "Stopping demexp server:"
stop
;;
restart)
echo -n "Restarting demexp server:"
stop
if [ $? -eq 0 ]; then
echo -n " - sleep 8s -"
sleep 8 # hardcoded in server, 7s + 1s of margin
start
fi
;;
reload|force-reload)
;;
esac
if [ $? -eq 0 ]; then
echo " done."
exit 0
else
echo " failed"
exit 1
fi
Best wishes,
d.
--
pub 1024D/A3AD7A2A 2004-10-03 David MENTRE <address@hidden>
5996 CC46 4612 9CA4 3562 D7AC 6C67 9E96 A3AD 7A2A
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Demexp-dev] Shell script to launch demexp server,
David MENTRE <=