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
36 # functions exist on RedHat. Provide tiny subset if unavailable
37 if test -f /etc/rc.d/init.d/functions; then
38 . /etc/rc.d/init.d/functions
42 while test $# -gt 0; do
53 startproc -p $pid_file $*
59 while test $# -gt 0; do
74 /sbin/killproc -p $pid_file $*
78 while test $# -gt 0; do
89 if test -f $pid_file && kill -0 `cat $pid_file`; then
90 echo "$DAEMON `cat $pid_file` is running"
93 echo "$DAEMON is not running"
97 # end of compatibility layer for RedHat/SuSE
99 OPTIONS="-u nobody -l /var/log/metaproxy.log -c /etc/metaproxy/metaproxy.xml"
101 if [ -f /etc/sysconfig/metaproxy ]; then
102 . /etc/sysconfig/metaproxy
105 DAEMON=${DAEMON-/usr/bin/metaproxy}
107 pidfile=${PIDFILE-/var/run/metaproxy.pid}
108 lockfile=${LOCKFILE-/var/lock/subsys/metaproxy}
112 echo -n $"Starting $prog: "
113 daemon --pidfile ${pidfile} $DAEMON $OPTIONS -D -p ${pidfile}
116 [ $RETVAL = 0 ] && touch ${lockfile}
121 echo -n $"Stopping $prog: "
122 killproc -p ${pidfile} -d 10 $DAEMON
125 [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
132 # See how we were called.
141 status -p ${pidfile} $DAEMON
149 if [ -f ${pidfile} ] ; then
162 echo $"Usage: $prog {start|stop|restart|help|configtest}"