2 # $Id: yazproxyctl.sh,v 1.3 2006-04-04 20:52:04 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.
11 DAEMON=/usr/local/bin/yazproxy
13 # Proxy PIDFILE. Must be writable by it.
14 PIDFILE="/var/run/yazproxy.pid"
17 LOGFILE=/var/log/yazproxy.log
22 # Run as this user. Set to empty to keep uid as is
25 # Extra args . Config file _WITH_ option
28 if test -n "$RUNAS"; then
29 ARGS="-u $RUNAS $ARGS"
32 # Increase number of sockets, if needed
35 # Name, Description (not essential)
39 test -d $DIR || exit 0
40 test -f $DAEMON || exit 0
46 printf "%s" "Starting $DESC: "
48 $DAEMON -l $LOGFILE -p $PIDFILE $ARGS @:$PORT &
52 printf "%s" "Stopping $DESC: "
54 if test -f $PIDFILE; then
59 echo "No PID $PIDFILE"
63 printf "%s" "Reloading $DESC: "
65 if test -f $PIDFILE; then
66 kill -HUP `cat $PIDFILE`
69 echo "No PID $PIDFILE"
73 printf "%s" "Restarting $DESC: "
75 if test -f $PIDFILE; then
80 $DAEMON -l $LOGFILE -p $PIDFILE $ARGS @:$PORT &
85 # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
86 echo "Usage: $N {start|stop|restart|force-reload}" >&2