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 . /etc/metaproxy/metaproxy.user
101 OPTIONS="-u $SERVER_USER -l /var/log/metaproxy.log -c /etc/metaproxy/metaproxy.xml"
103 if [ -f /etc/sysconfig/metaproxy ]; then
104 . /etc/sysconfig/metaproxy
107 DAEMON=${DAEMON-/usr/bin/metaproxy}
109 pidfile=${PIDFILE-/var/run/metaproxy.pid}
110 lockfile=${LOCKFILE-/var/lock/subsys/metaproxy}
114 echo -n $"Starting $prog: "
115 daemon --pidfile ${pidfile} $DAEMON $OPTIONS -D -p ${pidfile}
118 [ $RETVAL = 0 ] && touch ${lockfile}
123 echo -n $"Stopping $prog: "
124 killproc -p ${pidfile} -d 10 $DAEMON
127 [ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
134 # See how we were called.
143 status -p ${pidfile} $DAEMON
151 if [ -f ${pidfile} ] ; then
164 echo $"Usage: $prog {start|stop|restart|help|configtest}"