From: Wolfram Schneider Date: Mon, 12 Jan 2009 18:44:58 +0000 (+0100) Subject: Add a start/stop script for pazpar2. The start/restart arguments X-Git-Tag: v1.1.0~45 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=fe4e965e16384189a4932ffe064f7e07d26d23b7;p=pazpar2-moved-to-github.git Add a start/stop script for pazpar2. The start/restart arguments supports pazpar2 options, e.g. to restart pazpar2 with edu targets: ./src/pazpar2.sh restart -t etc/edu.xml --- diff --git a/src/pazpar2.sh b/src/pazpar2.sh new file mode 100755 index 0000000..528aa3d --- /dev/null +++ b/src/pazpar2.sh @@ -0,0 +1,38 @@ +#!/bin/sh +# +# pazpar2.sh - pazpar2 start/stop script + +PAZPAR2_HOME=$HOME/pazpar2 +pazpar2_program=$PAZPAR2_HOME/src/pazpar2 +pazpar2_config=$PAZPAR2_HOME/etc/pazpar2.cfg +pazpar2_pid=$PAZPAR2_HOME/pazpar2.pid +pazpar2_log=$PAZPAR2_HOME/pazpar2.log + +command=$1; shift + +case "$command" in + start) + $pazpar2_program -D -l $pazpar2_log -p $pazpar2_pid -f $pazpar2_config "$@" + ;; + + stop) + test -f $pazpar2_pid && kill `cat $pazpar2_pid` + ;; + + # graceful restart - not yet implemented by pazpar2 + graceful) + test -f $pazpar2_pid && kill -HUP `cat $pazpar2_pid` + ;; + + restart) + $0 stop + $0 start "$@" + ;; + + *) + echo "Usage: `basename $0` [ start [pazpar2 options]] [ stop | restart ]" >&2 + ;; +esac + +exit 0 +