Added Redhat boot script for zebrasrv.
authorAdam Dickmeiss <adam@indexdata.dk>
Fri, 21 Sep 2001 10:40:08 +0000 (10:40 +0000)
committerAdam Dickmeiss <adam@indexdata.dk>
Fri, 21 Sep 2001 10:40:08 +0000 (10:40 +0000)
util/Makefile.am
util/zebrasrv.rh [new file with mode: 0755]

index 886e75c..f17b1d8 100644 (file)
@@ -1,9 +1,11 @@
-## $Id: Makefile.am,v 1.2 2001-07-09 23:12:08 adam Exp $
+## $Id: Makefile.am,v 1.3 2001-09-21 10:40:08 adam Exp $
 
 noinst_LIBRARIES = libutil.a
 
 noinst_PROGRAMS = passtest
 
+EXTRA_DIST = zebrasrv.rh
+
 INCLUDES = -I$(srcdir)/../include @YAZINC@
 LDADD = libutil.a @YAZLIB@ @LIBS@
 
diff --git a/util/zebrasrv.rh b/util/zebrasrv.rh
new file mode 100755 (executable)
index 0000000..3361f2b
--- /dev/null
@@ -0,0 +1,51 @@
+#!/bin/bash
+#
+# chkconfig: 2345 85 15
+# description: Redhat init.d zebrasrv script.
+# processname: zebrasrv
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+zebradir=/home/meta/silkeborg/db
+srv=/home/meta/silkeborg/zmbol/index/zmbolsrv
+user=nobody
+       
+if [ ! -d ${zebradir} ]; then
+       echo "No directory $zebradir"
+       exit 0
+fi
+
+if [ ! -f ${srv} ]; then
+       echo "No server $srv"
+       exit 0
+fi
+
+cd $zebradir
+
+case "$1" in
+  start)
+       echo -n "Starting zebrasrv "
+
+       ${srv} -l srv.log -u $user tcp:@:210 &
+
+       echo
+       ;;
+  stop)
+       echo -n "Shutting zebrasrv "
+
+       kill `cat $zebradir/zebrasrv.pid`
+
+       echo ""
+       ;;
+  restart|reload)
+       $0 stop
+       $0 start
+       ;;
+  *)
+       echo "Usage: zebrasrv {start|stop|restart|reload}"
+       exit 1
+esac
+
+exit 0
+