]>
Commit | Line | Data |
---|---|---|
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 | if is_no "${NETWORKING}"; then | |
22 | msg_Network_Down "INN" | |
23 | exit 1 | |
24 | fi | |
25 | ||
26 | ||
27 | # See how we were called. | |
28 | case "$1" in | |
29 | start) | |
30 | if [ ! -f /var/lock/subsys/inn ]; then | |
31 | msg_starting "INN" | |
32 | daemon su - news -c inndstart | |
33 | if is_yes $DOINNWATCH ; then | |
34 | msg_starting "INN Watch" | |
35 | busy | |
36 | su - news -c "umask 002 ; /usr/bin/innwatch &" | |
37 | RETVAL=$? | |
38 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/inn | |
39 | if ps -C innwatch >/dev/null 2>&1; then | |
40 | deltext;ok | |
41 | else | |
42 | deltext;fail | |
43 | fi | |
44 | else | |
45 | touch /var/lock/subsys/inn | |
46 | fi | |
47 | else | |
48 | msg_Already_Running "INN" | |
49 | exit 1 | |
50 | fi | |
51 | ;; | |
52 | stop) | |
53 | if [ -f /var/lock/subsys/inn ]; then | |
54 | msg_stopping "INN" | |
55 | busy | |
56 | if ctlinnd shutdown "Stopping INN service";then | |
57 | deltext;ok | |
58 | else | |
59 | deltext;fail | |
60 | fi | |
61 | ||
62 | if [ -f /var/run/news/innwatch.pid ]; then | |
63 | msg_stopping "INN Watch" | |
64 | busy | |
65 | if killall -9 innwatch; then | |
66 | deltext;ok | |
67 | else | |
68 | deltext;died | |
69 | fi | |
70 | rm -f /var/run/news/innwatch.pid \ | |
71 | /var/run/news/LOCK.innwatch >/dev/null 2>&1 | |
72 | fi | |
73 | ||
74 | if [ -f /var/run/news/infeed.pid ]; then | |
75 | msg_stopping "INN Feed" | |
76 | killproc innfeed -9 | |
77 | rm -f /var/run/news/innfeed.pid >/dev/null 2>&1 | |
78 | fi | |
79 | ||
80 | if [ -f /var/run/news/actived.pid ]; then | |
81 | msg_stopping "INN Actived" | |
82 | killproc actived -9 | |
83 | rm -f /var/run/news/actived.pid >/dev/null 2>&1 | |
84 | fi | |
85 | ||
86 | else | |
87 | msg_Not_Running INN | |
88 | exit 1 | |
89 | fi | |
90 | rm -f /var/lock/subsys/inn >/dev/null 2>&1 | |
91 | ;; | |
92 | status) | |
93 | status innd | |
94 | ;; | |
95 | reload) | |
96 | if [ -f /var/lock/subsys/inn ]; then | |
97 | msg_reloading "INN" | |
98 | busy | |
99 | if ctlinnd reload all "Reloading" >/dev/null 2>&1; then | |
100 | deltext;ok | |
101 | else | |
102 | deltext;fail | |
103 | fi | |
104 | else | |
105 | msg_Not_Running INN | |
106 | exit 1 | |
107 | fi | |
108 | ;; | |
109 | restart) | |
110 | $0 stop | |
111 | sleep 2 | |
112 | $0 start | |
113 | ;; | |
114 | *) | |
115 | msg_Usage "$0 {start|stop|status|restart|reload}" | |
116 | exit 1 | |
117 | ;; | |
118 | esac | |
119 | ||
120 | exit $RETVAL |