File: init.d

package info (click to toggle)
inn2 2.2.2.2000.01.31-5
  • links: PTS
  • area: main
  • in suites: potato
  • size: 5,424 kB
  • ctags: 5,722
  • sloc: ansic: 61,219; perl: 9,939; sh: 5,644; makefile: 1,695; awk: 1,567; yacc: 1,548; lex: 249; tcl: 3
file content (42 lines) | stat: -rw-r--r-- 731 bytes parent folder | download
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
#! /bin/sh
#
# init.d/inn	Start/stop the news server.
#

test -f /usr/lib/news/bin/innd || exit 0

start () {
    start-stop-daemon --quiet --start --user news \
	--pidfile /var/run/news/innd.pid --startas /usr/lib/news/bin/rc.news
    sleep 1
}

stop () {
    if [ -f /var/run/news/innwatch.pid ]
    then
	start-stop-daemon --quiet --stop --pidfile /var/run/news/innwatch.pid
    fi
    start-stop-daemon --quiet --stop \
	--pidfile /var/run/news/innd.pid --exec /usr/lib/news/bin/innd
}

case "$1" in
    start)
	start
	;;
    stop)
	echo "Stopping news server: innd"
	stop
	;;
    restart|force-reload)
	stop
	sleep 2
	start
	;;
    *)
	echo "Usage: /etc/init.d/inn start|stop|restart|force-reload">&2
	exit 1
	;;
esac

exit 0