From fe4e965e16384189a4932ffe064f7e07d26d23b7 Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Mon, 12 Jan 2009 19:44:58 +0100 Subject: [PATCH] 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 --- src/pazpar2.sh | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 src/pazpar2.sh 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 + -- 1.7.10.4