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