]>
Commit | Line | Data |
---|---|---|
1 | #! /bin/sh | |
2 | # | |
3 | # innd InterNet News System | |
4 | # | |
5 | # chkconfig: 345 95 25 | |
6 | # | |
7 | # description: inn is the most popular server for Usenet news. It allows \ | |
8 | # you to setup local news servers. It can be difficult to \ | |
9 | # set up properly though, so be sure to read /usr/doc/inn* \ | |
10 | # before trying. | |
11 | ||
12 | ||
13 | # Source function library | |
14 | . /etc/rc.d/init.d/functions | |
15 | ||
16 | # Get network config | |
17 | . /etc/sysconfig/network | |
18 | ||
19 | # Get service config | |
20 | [ -f /etc/sysconfig/inn ] && . /etc/sysconfig/inn | |
21 | ||
22 | # Check that networking is up. | |
23 | if [ "${NETWORKING}" = "no" ]; then | |
24 | echo "WARNING: Networking is down. Inn service can't be runed " | |
25 | exit 1 | |
26 | fi | |
27 | ||
28 | # Sanity check | |
29 | [ -d /etc/news ] || exit 0 | |
30 | [ -d /usr/lib/news ] || exit 0 | |
31 | [ -d /var/spool/news ] || exit 0 | |
32 | ||
33 | ||
34 | # See how we were called. | |
35 | case "$1" in | |
36 | start) | |
37 | # Check if the service is already running? | |
38 | if [ ! -f /var/lock/subsys/news ]; then | |
39 | show Starting INND | |
40 | su news -c /etc/rc.d/rc.new | |
41 | else | |
42 | echo "portmap already is running" | |
43 | fi | |
44 | touch /var/lock/subsys/news | |
45 | ;; | |
46 | stop) | |
47 | echo -n "Stopping INND service: " | |
48 | su news -c "/usr/lib/news/bin/ctlinnd shutdown 'stop required'" & | |
49 | # give it a try to die gracefuly | |
50 | sleep 5 | |
51 | # just in case innd didn't die gracefully | |
52 | if [ -f /var/run/news/innd.pid ] | |
53 | then | |
54 | kill -9 `cat /var/run/news/innd.pid` | |
55 | rm -f /var/run/news/innd.pid | |
56 | fi | |
57 | # always echo that INND is shut down | |
58 | echo -n "innd " | |
59 | if [ -f /var/run/news/innwatch.pid ] | |
60 | then | |
61 | kill -9 `cat /var/run/news/innwatch.pid` | |
62 | rm -f /var/run/news/innwatch.pid | |
63 | echo -n "innwatch " | |
64 | fi | |
65 | echo | |
66 | rm -f /var/lock/subsys/news /var/lock/news/* | |
67 | ;; | |
68 | status) | |
69 | status innd | |
70 | ;; | |
71 | restart) | |
72 | $0 stop | |
73 | $0 start | |
74 | ;; | |
75 | reload) | |
76 | kill -HUP `cat /var/run/news/innd.pid` | |
77 | ;; | |
78 | *) | |
79 | echo "Usage: $0 {start|stop|status|restart|reload}" | |
80 | exit 1 | |
81 | esac | |
82 | ||
83 | exit 0 |