2 # $Id: yaz-proxy.sh,v 1.4 2003-11-25 21:54:02 adam Exp $
3 # YAZ proxy start/stop init.d script.
5 PATH=/usr/local/bin:/bin:/usr/bin
8 # Proxy CWD is here. Should be writable by it.
10 # Proxy Path (either the actual one, or the keepalive one (for testing)
11 DAEMON=/usr/local/bin/yaz-proxy
12 #DAEMON=/var/yaz-proxy/yaz-proxy-ka.sh
14 # Proxy PIDFILE. Must be writable by it.
15 PIDFILE="/var/run/yaz-proxy.pid"
18 LOGFILE=/var/log/yaz-proxy.log
23 # Run as this user. Set to empty to keep uid as is
26 # Extra args . Config file _WITH_ option
29 if test -n "RUNAS"; then
30 ARGS="-u $RUNAS $ARGS"
33 # Increase number of sockets, if needed
36 # Name, Description (not essential)
40 test -d $DIR || exit 0
41 test -f $DAEMON || exit 0
47 printf "%s" "Starting $DESC: "
49 $DAEMON -l $LOGFILE -p $PIDFILE $ARGS @:$PORT &
53 printf "%s" "Stopping $DESC: "
55 if test -f $PIDFILE; then
60 echo "No PID $PIDFILE"
64 if test -f $PIDFILE; then
65 kill -HUP `cat $PIDFILE`
69 printf "%s" "Restarting $DESC: "
70 if test -f $PIDFILE; then
76 $DAEMON -l $LOGFILE -p $PIDFILE $ARGS @:$PORT &
81 # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
82 echo "Usage: $N {start|stop|restart|force-reload}" >&2