]> git.pld-linux.org Git - packages/inn.git/blob - inn.init
- inn is now stoped by ctlinnd shutdown
[packages/inn.git] / inn.init
1 #! /bin/sh
2 #
3 # innd          InterNet News System
4 #
5 # chkconfig: 345 95 05
6 # description: inn is the most popular server for Usenet news. It allows \
7 #              you to setup local news servers. It can be difficult to \
8 #              set up properly though, so be sure to read /usr/doc/inn* \
9 #              before trying.
10
11 # Source function library.
12 . /etc/rc.d/init.d/functions
13
14 # Source networking configuration.
15 . /etc/sysconfig/network
16
17 # Daemon specific
18 . /usr/share/news/innshellvars
19
20 # Check that networking is up.
21 [ "${NETWORKING}" = "no" ] && exit 0
22
23 # See how we were called.
24 case "$1" in
25   start)
26         if [ ! -f /var/lock/subsys/inn ]; then
27             show Starting INN service
28             daemon inndstart
29             if `echo $DOINNWATCH | grep -q -e "[tTyY].*"`; then
30                 show Starting INN Watch service
31                 busy
32                 su - news -c "/usr/bin/innwatch &"
33                 if ps ax | grep -v grep | grep -q innwatch; then
34                     deltext;ok
35                 else
36                     deltext;fail
37                 fi
38             fi
39         else
40             echo 'INND is running'
41         fi
42         touch /var/lock/subsys/inn
43         ;;
44   stop)
45         if [ -f /var/run/news/innd.pid ]; then
46             show Stopping INN service
47             busy
48             if ctlinnd shutdown "Stopping INN service"; then
49                 deltext;ok
50             else
51                 deltext;died
52             fi
53         fi
54
55         if [ -f /var/run/news/innwatch.pid ]; then
56             show Stopping INN Watch service
57             busy
58             if killall -9 innwatch; then
59                 deltext;ok
60             else
61                 deltext;died
62             fi
63             rm -f /var/run/news/innwatch.pid /var/run/news/LOCK.innwatch
64         fi
65
66         if [ -f /var/run/news/infeed.pid ]; then
67             show Stopping INN Feed service
68             killproc innfeed -9
69             rm -f /var/run/news/innfeed.pid
70         fi
71
72         if [ -f /var/run/news/actived.pid ]; then
73             show Stopping INN Actived service
74             killproc actived -9
75             rm -f /var/run/news/actived.pid
76         fi
77
78         rm -f /var/lock/subsys/inn
79         ;;
80   status)
81         status innd
82         ;;
83   reload)
84         show Reloading INND service
85         killproc innd -HUP
86         ;;
87   restart)
88         $0 stop
89         $0 start
90         ;;
91   *)
92         echo "Usage: $0 {start|stop|status|restart}"
93         exit 1
94         ;;
95 esac
96
97 exit 0
This page took 0.064001 seconds and 4 git commands to generate.