]>
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 | |
eb7b5845 JR |
44 | else |
45 | touch /var/lock/subsys/inn | |
1fa6ba32 | 46 | fi |
98d873eb | 47 | else |
6948b9ba | 48 | msg_Already_Running "INN" |
49 | exit 1 | |
98d873eb | 50 | fi |
98d873eb | 51 | ;; |
52 | stop) | |
c747d3f4 | 53 | if [ -f /var/lock/subsys/inn ]; then |
c747d3f4 | 54 | msg_stopping "INN" |
55 | busy | |
56 | if ctlinnd shutdown "Stopping INN service";then | |
6948b9ba | 57 | deltext;ok |
c747d3f4 | 58 | else |
6948b9ba | 59 | deltext;fail |
c747d3f4 | 60 | fi |
ab0d6b82 | 61 | |
6948b9ba | 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 | |
ab0d6b82 | 73 | |
6948b9ba | 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 | |
c747d3f4 | 79 | |
6948b9ba | 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 | |
ab0d6b82 | 85 | |
c747d3f4 | 86 | else |
eb7b5845 | 87 | msg_Not_Running INN |
6948b9ba | 88 | exit 1 |
ab0d6b82 | 89 | fi |
6948b9ba | 90 | rm -f /var/lock/subsys/inn >/dev/null 2>&1 |
98d873eb | 91 | ;; |
92 | status) | |
93 | status innd | |
94 | ;; | |
95 | reload) | |
c747d3f4 | 96 | if [ -f /var/lock/subsys/inn ]; then |
81574cc8 | 97 | msg_reloading "INN" |
6948b9ba | 98 | busy |
81574cc8 | 99 | if ctlinnd reload all "Reloading" >/dev/null 2>&1; then |
6948b9ba | 100 | deltext;ok |
101 | else | |
102 | deltext;fail | |
103 | fi | |
104 | else | |
105 | msg_Not_Running INN | |
106 | exit 1 | |
c747d3f4 | 107 | fi |
98d873eb | 108 | ;; |
109 | restart) | |
110 | $0 stop | |
272d2413 | 111 | sleep 2 |
98d873eb | 112 | $0 start |
113 | ;; | |
114 | *) | |
c747d3f4 | 115 | msg_Usage "$0 {start|stop|status|restart|reload}" |
98d873eb | 116 | exit 1 |
117 | ;; | |
118 | esac | |
119 | ||
6948b9ba | 120 | exit $RETVAL |