3 # metaproxy Startup script for Metaproxy
5 # chkconfig: 2345 85 15
6 # description: Metaproxy SRU/Z39.50 router
7 # processname: metaproxy
8 # config: /etc/metaproxy/metaproxy.xml
9 # config: /etc/sysconfig/metaproxy
10 # pidfile: /var/run/metaproxy.pid
14 # Required-Start: $local_fs $remote_fs $network
15 # Required-Stop: $local_fs $remote_fs
17 # Default-Stop: 0 1 2 6
18 # Short-Description: Controls the metaproxy daemon
19 # Description: Controls the Metaproxy Z39.50/SRU router.
23 # start of compatibility layer for RedHat/SuSE init.d
25 # rc_status exist on SuSE. Provide dummy if unavailable
26 if test -f /etc/rc.status; then
34 # functions exist on RedHat. Provide tiny subset if unavailable
35 if test -f /etc/rc.d/init.d/functions; then
36 . /etc/rc.d/init.d/functions
40 while test $# -gt 0; do
51 startproc -p $pid_file $*
57 while test $# -gt 0; do
72 /sbin/killproc -p $pid_file $*
76 while test $# -gt 0; do
87 if test -f $pid_file && kill -0 `cat $pid_file`; then
88 echo "$DAEMON `cat $pid_file` is running"
91 echo "$DAEMON is not running"
95 # end of compatibility layer for RedHat/SuSE
97 OPTIONS="-u nobody -l /var/log/metaproxy.log -c /etc/metaproxy/metaproxy.xml"
99 if [ -f /etc/sysconfig/metaproxy ]; then
100 . /etc/sysconfig/metaproxy
103 DAEMON=${DAEMON-/usr/bin/metaproxy}
105 pidfile=${PIDFILE-/var/run/metaproxy.pid}
106 lockfile=${LOCKFILE-/var/lock/subsys/metaproxy}
110 echo -n $"Starting $prog: "
111 daemon --pidfile ${pidfile} $DAEMON $OPTIONS -D -p ${pidfile}
114 [ $RETVAL = 0 ] && touch ${lockfile}
119 echo -n $"Stopping $prog: "
120 killproc -p ${pidfile} -d 10 $DAEMON
123 [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
130 # See how we were called.
139 status -p ${pidfile} $DAEMON
147 if [ -f ${pidfile} ] ; then
160 echo $"Usage: $prog {start|stop|restart|help|configtest}"