File: inn2.init

package info (click to toggle)
inn2 2.4.3-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,180 kB
  • ctags: 19
  • sloc: sh: 546; makefile: 268
file content (52 lines) | stat: -rw-r--r-- 996 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
43
44
45
46
47
48
49
50
51
52
#!/bin/sh -e
#
# Start/stop the news server.
#

test -f /usr/lib/news/bin/rc.news || exit 0

start () {
    if [ ! -d /var/run/news ]; then
	mkdir -p /var/run/news
	chown news:news /var/run/news
	chmod 775 /var/run/news
    fi
    su news -c /usr/lib/news/bin/rc.news > /var/log/news/rc.news 2>&1
}

stop () {
    su news -c '/usr/lib/news/bin/rc.news stop' >> /var/log/news/rc.news 2>&1
}

case "$1" in
    start)
	echo -n "Starting news server: "
	start
	echo "done."
	;;
    stop)
	echo -n "Stopping news server: "
	stop
	echo "done."
	;;
    reload|force-reload)
	echo -n "Reloading most INN configuration files: "
	ctlinnd -t 20 reload '' /etc/init.d/inn2
	;;
    restart)
	echo -n "Restarting innd: "
	if [ -f /var/run/news/innd.pid ]; then
	    ctlinnd -t 20 throttle "init script" > /dev/null || true
	    ctlinnd -t 20 xexec inndstart > /dev/null || start
	else
	    start
	fi
	echo "done."
	;;
    *)
	echo "Usage: /etc/init.d/inn start|stop|restart|reload">&2
	exit 1
	;;
esac

exit 0