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
12 # start of compatibility layer for RedHat/SuSE init.d
14 # rc.status exist on SuSE. Provide dummy if unavailable
15 if test -f /etc/rc.status; then
23 # functions exist on RedHat. Provide tiny subset if unavailable
24 if test -f /etc/rc.d/init.d/functions; then
25 . /etc/rc.d/init.d/functions
29 while test $# -gt 0; do
40 startproc -p $pid_file $*
46 while test $# -gt 0; do
61 /sbin/killproc -p $pid_file $*
65 while test $# -gt 0; do
76 if test -f $pid_file && kill -0 `cat $pid_file`; then
77 echo "$DAEMON `cat $pid_file` is running"
80 echo "$DAEMON is not running"
84 # end of compatibility layer for RedHat/SuSE
86 OPTIONS="-u nobody -l /var/log/metaproxy.log -c /etc/metaproxy/metaproxy.xml"
88 if [ -f /etc/sysconfig/metaproxy ]; then
89 . /etc/sysconfig/metaproxy
92 DAEMON=${DAEMON-/usr/bin/metaproxy}
94 pidfile=${PIDFILE-/var/run/metaproxy.pid}
95 lockfile=${LOCKFILE-/var/lock/subsys/metaproxy}
99 echo -n $"Starting $prog: "
100 daemon --pidfile ${pidfile} $DAEMON $OPTIONS -D -p ${pidfile}
103 [ $RETVAL = 0 ] && touch ${lockfile}
108 echo -n $"Stopping $prog: "
109 killproc -p ${pidfile} -d 10 $DAEMON
112 [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
119 # See how we were called.
128 status -p ${pidfile} $DAEMON
136 if [ -f ${pidfile} ] ; then
149 echo $"Usage: $prog {start|stop|restart|help|configtest}"