File: inn2.init

package info (click to toggle)
inn2 2.7.3-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 10,728 kB
  • sloc: ansic: 102,029; perl: 16,837; sh: 16,752; makefile: 4,014; yacc: 798; lex: 270; python: 268; sql: 192
file content (68 lines) | stat: -rw-r--r-- 1,555 bytes parent folder | download | duplicates (7)
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
#!/bin/sh -e
### BEGIN INIT INFO
# Provides:          inn2
# Required-Start:    $local_fs $remote_fs $syslog
# Required-Stop:     $local_fs $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: INN news server
# Description:       The InterNetNews news server.
### END INIT INFO
#
# Start/stop the news server.
#

. /lib/lsb/init-functions

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

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

stop () {
    start-stop-daemon --start --oknodo --chuid news:news \
      --exec /usr/lib/news/bin/rc.news -- stop >> /var/log/news/rc.news 2>&1
}

case "$1" in
    start)
	log_daemon_msg "Starting news server" "innd"
	start
	log_end_msg 0
	;;
    stop)
	log_daemon_msg "Stopping news server" "innd"
	stop
	log_end_msg 0
	;;
    reload|force-reload)
	echo -n "Reloading most INN configuration files: "
	ctlinnd -t 20 reload '' 'init script'
	;;
    restart)
	log_daemon_msg "Restarting news server" "innd"
	if [ -f /run/news/innd.pid ]; then
	    ctlinnd -t 20 throttle 'init script' > /dev/null || true
	    ctlinnd -t 20 xexec innd > /dev/null || start
	else
	    start
	fi
	log_end_msg 0
	;;
    status)
	status_of_proc -p /run/news/innd.pid /usr/lib/news/bin/innd INN
	;;
    *)
	log_action_msg "Usage: /etc/init.d/inn2 {start|stop|restart|reload}"
	exit 1
	;;
esac

exit 0