]> git.pld-linux.org Git - packages/inn.git/blob - inn.init
- updated
[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             killproc innd
48             rm -f /var/run/news/innd.pid
49         fi
50
51         if [ -f /var/run/news/innwatch.pid ]; then
52             show Stopping INN Watch service
53             busy
54             if killall -9 innwatch; then
55                 deltext;ok
56             else
57                 deltext;died
58             fi
59             rm -f /var/run/news/innwatch.pid /var/run/news/LOCK.innwatch
60         fi
61
62         if [ -f /var/run/news/infeed.pid ]; then
63             show Stopping INN Feed service
64             killproc innfeed -9
65             rm -f /var/run/news/innfeed.pid
66         fi
67
68         if [ -f /var/run/news/actived.pid ]; then
69             show Stopping INN Actived service
70             killproc actived -9
71             rm -f /var/run/news/actived.pid
72         fi
73
74         rm -f /var/lock/subsys/inn
75         ;;
76   status)
77         status innd
78         ;;
79   reload)
80         show Reloading INND service
81         killproc innd -HUP
82         ;;
83   restart)
84         $0 stop
85         $0 start
86         ;;
87   *)
88         echo "Usage: $0 {start|stop|status|restart}"
89         exit 1
90         ;;
91 esac
92
93 exit 0
This page took 0.0978 seconds and 3 git commands to generate.