]> git.pld-linux.org Git - packages/inn.git/blame - inn.init
- modified perms for logrotate
[packages/inn.git] / inn.init
CommitLineData
98d873eb 1#! /bin/sh
2#
3# innd InterNet News System
4#
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.
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 21if is_no "${NETWORKING}"; then
22 msg_Network_Down INN
23 exit 1
24fi
25
98d873eb 26
27# See how we were called.
28case "$1" in
29 start)
ab0d6b82 30 if [ ! -f /var/lock/subsys/inn ]; then
c747d3f4 31 msg_starting "INN"
e13eb9d5 32 daemon inndstart
c747d3f4 33 if is_yes $DOINNWATCH ; then
34 msg_starting "INN Watch"
1fa6ba32 35 busy
36 su - news -c "/usr/bin/innwatch &"
c747d3f4 37 if ps -C innwatch >/dev/null 2>&1; then
1fa6ba32 38 deltext;ok
39 else
40 deltext;fail
41 fi
42 fi
c747d3f4 43 touch /var/lock/subsys/inn
98d873eb 44 else
c747d3f4 45 msg_Already_Running "INN"
46 exit 1
98d873eb 47 fi
48 touch /var/lock/subsys/inn
49 ;;
50 stop)
c747d3f4 51 if [ -f /var/lock/subsys/inn ]; then
52
53 if [ -f /var/run/news/innd.pid ]; then
54 msg_stopping "INN"
55 busy
56 if ctlinnd shutdown "Stopping INN service";then
57 deltext;ok
58 else
59 deltext;fail
60 fi
d292d3db 61 fi
ab0d6b82 62
c747d3f4 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 /var/run/news/LOCK.innwatch >/dev/null 2>&1
1fa6ba32 72 fi
ab0d6b82 73
c747d3f4 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
79
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
87 msg_Already_Running INN
88 exit 1
ab0d6b82 89 fi
90
c747d3f4 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
98 msg_reload "INN"
99 busy
100 if ctlinnd reload all "Reloading";then
101 deltext;ok
102 else
103 deltext;fail
104 fi
105 else
106 msg_Not_Running INN
107 exit 1
108 fi
98d873eb 109 ;;
110 restart)
111 $0 stop
272d2413 112 sleep 2
98d873eb 113 $0 start
114 ;;
115 *)
c747d3f4 116 msg_Usage "$0 {start|stop|status|restart|reload}"
98d873eb 117 exit 1
118 ;;
119esac
120
121exit 0
This page took 0.112074 seconds and 4 git commands to generate.