From 832a7cfb01c097bb6afeac6f767b9a61c5355203 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Sun, 18 Jan 2004 21:11:11 +0000 Subject: [PATCH] Debian sample init.d YAZ server script --- etc/Makefile.am | 4 ++-- etc/debian.init.d | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+), 2 deletions(-) create mode 100755 etc/debian.init.d diff --git a/etc/Makefile.am b/etc/Makefile.am index 8b6c5ac..1e6c6bc 100644 --- a/etc/Makefile.am +++ b/etc/Makefile.am @@ -1,4 +1,4 @@ -# $Id: Makefile.am,v 1.2 2003-05-22 22:32:08 mike Exp $ +# $Id: Makefile.am,v 1.3 2004-01-18 21:11:11 adam Exp $ etcdatadir = $(pkgdatadir)/etc etcdata_DATA = pqf.properties \ @@ -8,5 +8,5 @@ etcdata_DATA = pqf.properties \ MARC21slim2RDFDC.xsl \ MARC21slimUtils.xsl -EXTRA_DIST = $(etcdata_DATA) +EXTRA_DIST = $(etcdata_DATA) debian.init.d diff --git a/etc/debian.init.d b/etc/debian.init.d new file mode 100755 index 0000000..82592b8 --- /dev/null +++ b/etc/debian.init.d @@ -0,0 +1,50 @@ +#! /bin/sh +# $Id: debian.init.d,v 1.1 2004-01-18 21:11:11 adam Exp $ +# Debian sample start/stop script for YAZ Generic Frontend Server +# +set -e + +DAEMON=/usr/local/bin/yaz-ztest +NAME=yaz-ztest +PIDFILE=/var/run/yaz-ztest.pid +LOGFILE=/var/log/yaz-ztest.log +RUNAS=nobody + +test -x $DAEMON || exit 0 + +case "$1" in + start) + echo -n "Starting YAZ server: " + start-stop-daemon --start --pidfile $PIDFILE \ + --exec $DAEMON -- \ + -u $RUNAS -l $LOGFILE -D -p $PIDFILE @:210 + + echo "$NAME." + ;; + stop) + echo -n "Stopping YAZ server: " + start-stop-daemon --stop --pidfile $PIDFILE \ + --oknodo --retry 30 --exec $DAEMON + echo "$NAME." + ;; + restart) + echo -n "Restarting YAZ server: " + start-stop-daemon --stop --pidfile $PIDFILE \ + --oknodo --retry 30 --exec $DAEMON + start-stop-daemon --start --pidfile $PIDFILE d \ + --exec $DAEMON -- \ + -u $RUNAS -l $LOGFILE -D -p $PIDFILE @:210 + echo "$NAME." + ;; + reload|force-reload) + echo "Reloading $NAME configuration files" + start-stop-daemon --stop --pidfile $PIDFILE \ + --signal 1 --exec $DAEMON + ;; + *) + echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload}" + exit 1 + ;; +esac + +exit 0 -- 1.7.10.4