File: debian.init.d

package info (click to toggle)
yaz 2.1.18-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 11,988 kB
  • ctags: 11,045
  • sloc: xml: 109,719; ansic: 41,566; sh: 10,625; makefile: 1,115; tcl: 380; yacc: 288
file content (50 lines) | stat: -rwxr-xr-x 1,232 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#! /bin/sh
# $Id: debian.init.d,v 1.1 2004/01/18 21:11:11 adam Exp $
# Debian sample start/stop script for YAZ Generic Frontend Server
#
set -e

DAEMON=/usr/local/bin/yaz-ztest
NAME=yaz-ztest
PIDFILE=/var/run/yaz-ztest.pid
LOGFILE=/var/log/yaz-ztest.log
RUNAS=nobody

test -x $DAEMON || exit 0

case "$1" in
  start)
    echo -n "Starting YAZ server: "
    start-stop-daemon --start --pidfile $PIDFILE \
			    --exec $DAEMON -- \
			    -u $RUNAS -l $LOGFILE -D -p $PIDFILE @:210
			  
    echo "$NAME."
    ;;
  stop)
    echo -n "Stopping YAZ server: "
    start-stop-daemon --stop --pidfile $PIDFILE \
			    --oknodo --retry 30 --exec $DAEMON
    echo "$NAME."
      ;;
  restart)
    echo -n "Restarting YAZ server: "
    start-stop-daemon --stop --pidfile $PIDFILE  \
			    --oknodo --retry 30 --exec $DAEMON
    start-stop-daemon --start --pidfile $PIDFILE d \
			    --exec $DAEMON -- \
			    -u $RUNAS -l $LOGFILE -D -p $PIDFILE @:210
    echo "$NAME."
    ;;
  reload|force-reload)
    echo "Reloading $NAME configuration files"
    start-stop-daemon --stop --pidfile $PIDFILE \
			    --signal 1 --exec $DAEMON
    ;;
  *)
    echo "Usage: /etc/init.d/$NAME {start|stop|restart|reload}"
    exit 1
    ;;
esac

exit 0