File: roundup.init

package info (click to toggle)
roundup 1.2.1-10%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 4,764 kB
  • ctags: 3,756
  • sloc: python: 30,296; sh: 1,497; perl: 23; makefile: 22
file content (94 lines) | stat: -rw-r--r-- 1,945 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/bin/sh -e
#
# roundup	Startup script for the roundup http server.
#
# Version:	$Id$
#
### BEGIN INIT INFO
# Provides:          roundup
# Required-Start:    $syslog $network
# Required-Stop:     $syslog $network
# Should-Start:      $local_fs
# Should-Stop:       $local_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start the stand-alone roundup HTTP server
# Description:       Start the stand-alone roundup HTTP server
### END INIT INFO


DESC='Roundup HTTP-Server'

BINFILE=roundup-server
EXECUTABLE=/usr/bin/$BINFILE
### to be taken from /etc/roundup/roundup-server.ini:
#PIDFILE=/var/run/roundup/server.pid
#LOGFILE=/var/log/roundup/roundup.log
CONFFILE=/etc/roundup/roundup-server.ini

# short circuit this init script in case the user prefers runit:
NOINIT=0

if test -f /etc/default/roundup; then
	. /etc/default/roundup
fi

USERUNIT=${USERUNIT:=0}


if [ ${USERUNIT} -eq 1 ] && [ -d /var/service ]; then
	# make sure there is a runit link present:
	if [ ! -e /var/service/roundup ]; then
		ln -s /etc/roundup/service /var/service/roundup
	fi
	NOINIT=1
fi

EXTRAOPTS=""

if [ X${USER} != X ]; then
	OPTIONS="-- -u ${USER:=roundup} $EXTRAOPTS -C ${CONFFILE}"
else
	OPTIONS="-- $EXTRAOPTS -C ${CONFFILE}"
fi

test -x $EXECUTABLE || exit 0

start_stop() {
	case "$1" in
	start)
		printf "Starting $DESC:"
		start-stop-daemon --start --oknodo --quiet \
                                  --pidfile $PIDFILE \
				  --exec $EXECUTABLE $OPTIONS
		printf " $BINFILE"
		printf ".\n"
		;;
	stop)
		printf "Stopping $DESC:"
		start-stop-daemon --stop --oknodo --quiet \
                                  --pidfile $PIDFILE
		printf " $BINFILE"
		printf ".\n"
		;;
	restart | force-reload)
		start_stop stop
		sleep 1
		start_stop start
		;;
	*)
		printf "Usage: $0 {start|stop|restart|force-reload}\n" >&2
		exit 1
		;;
	esac
}


if [ ${NOINIT} -eq 1 ]; then
	roundup-ctl "$@"
else
	start_stop "$@"
fi

exit 0