]> git.pld-linux.org Git - packages/NewsCache.git/blob - NewsCache.init
- fixes for info page taken from
[packages/NewsCache.git] / NewsCache.init
1 #!/bin/sh
2 #
3 # newscache     newscache - news caching daemon 
4 #
5 # chkconfig:    345 90 10       
6 #
7 # description:  NewsCache acts to news reading clients like a news server,\
8 #               except that it stores only those articles that have been\
9 #               requested by at least one client. NewsCache targets problems\
10 #               of the current News System like network bandwidth consumption\
11 #               or the IO load caused by news clients.
12 #
13
14 # Source function library
15 . /etc/rc.d/init.d/functions
16
17 # Get network config
18 . /etc/sysconfig/network
19
20 # Get service config - may override defaults
21 [ -f /etc/sysconfig/newscache ] && . /etc/sysconfig/newscache
22
23 # Check that networking is up.
24 if is_yes "${NETWORKING}"; then
25         if [ ! -f /var/lock/subsys/network ]; then
26                 # nls "ERROR: Networking is down. %s can't be run." newscache
27                 msg_network_down newscache
28                 exit 1
29         fi
30 else
31         exit 0
32 fi
33
34
35 # See how we were called.
36 case "$1" in
37   start)
38         # Check if the service is already running?
39         if [ ! -f /var/lock/subsys/newscache ]; then
40                 # show "Starting %s service" newscache
41                 msg_starting newscache
42                 daemon newscache
43                 RETVAL=$?
44                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/newscache
45         else
46                 # show "%s service is already running." newscache
47                 msg_already_running newscache
48         fi
49         ;;
50   stop)
51         if [ -f /var/lock/subsys/newscache ]; then
52                 # Stop daemons.
53                 # show "Stopping %s service" newscache
54                 msg_stopping newscache
55                 killproc newscache
56                 rm -f /var/lock/subsys/newscache
57         else
58                 # show "%s service is not running." newscache
59                 msg_not_running newscache
60         fi
61         ;;
62   restart)
63         $0 stop
64         $0 start
65         exit $?
66         ;;
67   reload)
68         if [ -f /var/lock/subsys/newscache ]; then
69                 # show "Reload %s service" newscache
70                 msg_reloading newscache
71                 killproc newscache -HUP
72                 RETVAL=$?
73         else
74                 # show "%s service is not running." newscache
75                 msg_not_running newscache >&2
76                 RETVAL=7
77         fi
78         ;;
79   force-reload)
80         # if program allows reloading without stopping
81         $0 reload
82
83         # or if it doesn't
84         $0 restart
85
86         exit $?
87         ;;
88   status)
89         status newscache
90         RETVAL=$?
91         ;;
92   *)
93         # show "Usage: %s {start|stop|restart|reload|force-reload|status}"
94         msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
95         exit 3
96 esac
97
98 exit $RETVAL
99
100 # This must be last line !
101 # vi:syntax=sh:tw=78:ts=8:sw=4
This page took 0.088101 seconds and 3 git commands to generate.