]> git.pld-linux.org Git - packages/amavis-stats.git/blame - amavis-stats.init
- drop obsolete and outdated manual inclusion of rpm macros
[packages/amavis-stats.git] / amavis-stats.init
CommitLineData
57979306 1#!/bin/sh
2#
5c12888b 3# amavis-stats This shell script takes care of starting and stopping amavis stats collector
57979306 4#
5# chkconfig: 345 86 14
6# description: amavis statistics collector
7# processname: amavis-stats
8#
9# pidfile: /var/run/amavis-stats.pid
10
11# Source function library.
12. /etc/rc.d/init.d/functions
13
14# Source networking configuration.
15. /etc/sysconfig/network
16
17# Check that networking is up.
18if is_yes "${NETWORKING}"; then
19 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
deb91bdb 20 msg_network_down "Amavis Stats"
57979306 21 exit 1
22 fi
23else
24 exit 0
25fi
26
a06fcdc3 27start() {
57979306 28 # Start daemons.
29 if [ ! -f /var/lock/subsys/amavis-stats ]; then
deb91bdb 30 msg_starting "Amavis Stats"
86fa2021 31 daemon /usr/sbin/amavis-stats
57979306 32 RETVAL=$?
33 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/amavis-stats
34 else
deb91bdb 35 msg_already_running "Amavis Stats"
57979306 36 fi
a06fcdc3
ER
37}
38
39stop() {
57979306 40 # Stop daemons.
41 if [ -f /var/lock/subsys/amavis-stats ]; then
deb91bdb 42 msg_stopping "Amavis Stats"
57979306 43 killproc amavis-stats
44 rm -f /var/lock/subsys/amavis-stats >/dev/null 2>&1
45 else
deb91bdb 46 msg_not_running "Amavis Stats"
57979306 47 fi
a06fcdc3
ER
48}
49
ae3e1bf5
ER
50condrestart() {
51 if [ -f /var/lock/subsys/amavis-stats ]; then
52 stop
53 start
54 else
55 msg_not_running "Amavis Stats"
56 RETVAL=$1
57 fi
58}
59
a06fcdc3
ER
60RETVAL=0
61# See how we were called.
62case "$1" in
63 start)
64 start
65 ;;
66 stop)
67 stop
57979306 68 ;;
ae3e1bf5 69 restart)
a06fcdc3
ER
70 stop
71 start
57979306 72 ;;
ae3e1bf5
ER
73 try-restart)
74 condrestart 0
75 ;;
76 force-reload)
77 condrestart 7
78 ;;
57979306 79 status)
86fa2021 80 status Amavis-Stats
57979306 81 exit $?
82 ;;
83 *)
ae3e1bf5 84 msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
57979306 85 exit 3
86esac
87
88exit $RETVAL
This page took 0.078992 seconds and 4 git commands to generate.