2 # YAZ proxy start/stop init.d script.
4 PATH=/usr/local/bin:/bin:/usr/bin
7 # Proxy CWD is here. Should be writable by it.
10 DAEMON=/usr/local/bin/yazproxy
12 # Proxy PIDFILE. Must be writable by it.
13 PIDFILE="/var/run/yazproxy.pid"
16 LOGFILE=/var/log/yazproxy.log
21 # Run as this user. Set to empty to keep uid as is
24 # Extra args . Config file _WITH_ option
27 if test -n "$RUNAS"; then
28 ARGS="-u $RUNAS $ARGS"
31 # Increase number of sockets, if needed
34 # Name, Description (not essential)
38 test -d $DIR || exit 0
39 test -f $DAEMON || exit 0
45 printf "%s" "Starting $DESC: "
47 $DAEMON -l $LOGFILE -p $PIDFILE $ARGS @:$PORT &
51 printf "%s" "Stopping $DESC: "
53 if test -f $PIDFILE; then
58 echo "No PID $PIDFILE"
62 printf "%s" "Reloading $DESC: "
64 if test -f $PIDFILE; then
65 kill -HUP `cat $PIDFILE`
68 echo "No PID $PIDFILE"
72 printf "%s" "Restarting $DESC: "
74 if test -f $PIDFILE; then
79 $DAEMON -l $LOGFILE -p $PIDFILE $ARGS @:$PORT &
84 # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
85 echo "Usage: $N {start|stop|restart|force-reload}" >&2