]> git.pld-linux.org Git - packages/inn.git/blame - inn.init
-added
[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.
21[ "${NETWORKING}" = "no" ] && exit 0
22
23# See how we were called.
24case "$1" in
25 start)
ab0d6b82 26 if [ ! -f /var/lock/subsys/inn ]; then
27 show Starting INN service
e13eb9d5 28 daemon inndstart
1fa6ba32 29 if `echo $DOINNWATCH | grep -q -e "[tTyY].*"`; then
30 show Starting INN Watch service
31 busy
32 su - news -c "/usr/bin/innwatch &"
33 if ps ax | grep -v grep | grep -q innwatch; then
34 deltext;ok
35 else
36 deltext;fail
37 fi
38 fi
98d873eb 39 else
40 echo 'INND is running'
41 fi
42 touch /var/lock/subsys/inn
43 ;;
44 stop)
ab0d6b82 45 if [ -f /var/run/news/innd.pid ]; then
e13eb9d5 46 show Stopping INN service
d292d3db 47 busy
48 if ctlinnd shutdown "Stopping INN service"; then
49 deltext;ok
50 else
51 deltext;died
52 fi
ab0d6b82 53 fi
54
1fa6ba32 55 if [ -f /var/run/news/innwatch.pid ]; then
56 show Stopping INN Watch service
57 busy
58 if killall -9 innwatch; then
59 deltext;ok
60 else
61 deltext;died
62 fi
63 rm -f /var/run/news/innwatch.pid /var/run/news/LOCK.innwatch
64 fi
ab0d6b82 65
66 if [ -f /var/run/news/infeed.pid ]; then
e13eb9d5 67 show Stopping INN Feed service
ab0d6b82 68 killproc innfeed -9
e13eb9d5 69 rm -f /var/run/news/innfeed.pid
ab0d6b82 70 fi
71
72 if [ -f /var/run/news/actived.pid ]; then
73 show Stopping INN Actived service
74 killproc actived -9
75 rm -f /var/run/news/actived.pid
76 fi
77
98d873eb 78 rm -f /var/lock/subsys/inn
79 ;;
80 status)
81 status innd
82 ;;
83 reload)
84 show Reloading INND service
85 killproc innd -HUP
86 ;;
87 restart)
88 $0 stop
89 $0 start
90 ;;
91 *)
92 echo "Usage: $0 {start|stop|status|restart}"
93 exit 1
94 ;;
95esac
96
97exit 0
This page took 0.077696 seconds and 4 git commands to generate.