]>
Commit | Line | Data |
---|---|---|
2a22f805 | 1 | #! /bin/sh |
2 | # | |
3 | # innd InterNet News System | |
4 | # | |
5 | # chkconfig: - 95 25 | |
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 | # Get config. | |
15 | . /etc/sysconfig/network | |
16 | ||
17 | # Check that networking is up. | |
18 | if [ ${NETWORKING} = "no" ] | |
19 | then | |
20 | exit 0 | |
21 | fi | |
22 | ||
23 | [ -d /etc/news ] || exit 0 | |
24 | [ -d /usr/lib/news ] || exit 0 | |
25 | [ -d /var/spool/news ] || exit 0 | |
26 | ||
27 | # See how we were called. | |
28 | case "$1" in | |
29 | start) | |
30 | echo -n "Starting INND system: " | |
31 | su news -c /etc/rc.d/rc.news | |
32 | touch /var/lock/subsys/news | |
33 | ;; | |
34 | stop) | |
35 | echo -n "Stopping INND service: " | |
36 | su news -c "/usr/lib/news/bin/ctlinnd shutdown 'stop required'" & | |
37 | # give it a try to die gracefuly | |
38 | sleep 5 | |
39 | # just in case innd didn't die gracefully | |
40 | if [ -f /var/run/news/innd.pid ] | |
41 | then | |
42 | kill -9 `cat /var/run/news/innd.pid` | |
43 | rm -f /var/run/news/innd.pid | |
44 | fi | |
45 | # always echo that INND is shut down | |
46 | echo -n "innd " | |
47 | if [ -f /var/run/news/innwatch.pid ] | |
48 | then | |
49 | kill -9 `cat /var/run/news/innwatch.pid` | |
50 | rm -f /var/run/news/innwatch.pid | |
51 | echo -n "innwatch " | |
52 | fi | |
53 | echo | |
54 | rm -f /var/lock/subsys/news /var/lock/news/* | |
55 | ;; | |
56 | status) | |
57 | status innd | |
58 | ;; | |
59 | restart) | |
60 | kill -HUP `cat /var/run/news/innd.pid` | |
61 | ;; | |
62 | *) | |
63 | echo "Usage: $0 {start|stop|status|restart}" | |
64 | exit 1 | |
65 | esac | |
66 | ||
67 | exit 0 |