]>
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 |
6d8c3adf | 22 | msg_network_down "INN" |
6948b9ba | 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" |
25748b4f | 32 | daemon su news -c inndstart |
6948b9ba | 33 | if is_yes $DOINNWATCH ; then |
34 | msg_starting "INN Watch" | |
35 | busy | |
25748b4f | 36 | su news -c "umask 002 ; /usr/bin/setsid /usr/bin/innwatch &" </dev/null >&0 2>&0 |
6948b9ba | 37 | RETVAL=$? |
38 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/inn | |
e79be8fe | 39 | ps -C innwatch >/dev/null 2>&1 || usleep 500000 |
6948b9ba | 40 | if ps -C innwatch >/dev/null 2>&1; then |
41 | deltext;ok | |
42 | else | |
43 | deltext;fail | |
44 | fi | |
eb7b5845 JR |
45 | else |
46 | touch /var/lock/subsys/inn | |
1fa6ba32 | 47 | fi |
98d873eb | 48 | else |
6d8c3adf | 49 | msg_already_running "INN" |
6948b9ba | 50 | exit 1 |
98d873eb | 51 | fi |
98d873eb | 52 | ;; |
53 | stop) | |
c747d3f4 | 54 | if [ -f /var/lock/subsys/inn ]; then |
c747d3f4 | 55 | msg_stopping "INN" |
56 | busy | |
57 | if ctlinnd shutdown "Stopping INN service";then | |
6948b9ba | 58 | deltext;ok |
c747d3f4 | 59 | else |
6948b9ba | 60 | deltext;fail |
c747d3f4 | 61 | fi |
ab0d6b82 | 62 | |
6948b9ba | 63 | if [ -f /var/run/news/innwatch.pid ]; then |
64 | msg_stopping "INN Watch" | |
65 | busy | |
66 | if killall -9 innwatch; then | |
67 | deltext;ok | |
68 | else | |
69 | deltext;died | |
70 | fi | |
71 | rm -f /var/run/news/innwatch.pid \ | |
72 | /var/run/news/LOCK.innwatch >/dev/null 2>&1 | |
73 | fi | |
ab0d6b82 | 74 | |
6948b9ba | 75 | if [ -f /var/run/news/infeed.pid ]; then |
76 | msg_stopping "INN Feed" | |
77 | killproc innfeed -9 | |
78 | rm -f /var/run/news/innfeed.pid >/dev/null 2>&1 | |
79 | fi | |
c747d3f4 | 80 | |
6948b9ba | 81 | if [ -f /var/run/news/actived.pid ]; then |
82 | msg_stopping "INN Actived" | |
83 | killproc actived -9 | |
84 | rm -f /var/run/news/actived.pid >/dev/null 2>&1 | |
85 | fi | |
ab0d6b82 | 86 | |
c747d3f4 | 87 | else |
6d8c3adf | 88 | msg_not_running INN |
6948b9ba | 89 | exit 1 |
ab0d6b82 | 90 | fi |
6948b9ba | 91 | rm -f /var/lock/subsys/inn >/dev/null 2>&1 |
98d873eb | 92 | ;; |
93 | status) | |
94 | status innd | |
95 | ;; | |
96 | reload) | |
c747d3f4 | 97 | if [ -f /var/lock/subsys/inn ]; then |
81574cc8 | 98 | msg_reloading "INN" |
6948b9ba | 99 | busy |
81574cc8 | 100 | if ctlinnd reload all "Reloading" >/dev/null 2>&1; then |
6948b9ba | 101 | deltext;ok |
102 | else | |
103 | deltext;fail | |
104 | fi | |
105 | else | |
6d8c3adf | 106 | msg_not_running INN |
6948b9ba | 107 | exit 1 |
c747d3f4 | 108 | fi |
98d873eb | 109 | ;; |
110 | restart) | |
111 | $0 stop | |
272d2413 | 112 | sleep 2 |
98d873eb | 113 | $0 start |
114 | ;; | |
115 | *) | |
6d8c3adf | 116 | msg_usage "$0 {start|stop|status|restart|reload}" |
98d873eb | 117 | exit 1 |
118 | ;; | |
119 | esac | |
120 | ||
6948b9ba | 121 | exit $RETVAL |