Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 - 1
#!/bin/sh
2
#
3
# amavisd	This script controls the amavisd-new daemon.
4
#		(to be used with version amavisd-new-20020630 or later)
5
#
6
 
7
# chkconfig: - 79 31
8
# description: amavisd is an interface between MTA and content checkers
9
# processname: amavisd
10
# pidfile: /var/run/amavisd/amavisd.pid
11
 
12
# Source function library.
13
. /etc/rc.d/init.d/functions
14
 
15
## Source networking configuration.
16
#. /etc/sysconfig/network
17
 
18
#prog="/opt/amavisd-new/sbin/amavisd"
19
prog="/usr/sbin/amavisd"
20
prog_base="$(basename ${prog})"
21
 
22
prog_config_file="/etc/amavisd/amavisd.conf"
23
 
24
# Source configuration.
25
[ -e /etc/sysconfig/${prog_base} ] && . /etc/sysconfig/${prog_base}
26
 
27
## Check that networking is up.
28
#[ ${NETWORKING} = "no" ] && exit 0
29
 
30
RETVAL=0
31
 
32
# See how we were called.
33
case "$1" in
34
  start)
35
	action $"Starting ${prog_base}:" ${prog} -c ${prog_config_file}
36
	RETVAL=$?
37
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/${prog_base}
38
	echo
39
	;;
40
  stop)
41
	action $"Shutting down ${prog_base}:" ${prog} -c ${prog_config_file} stop
42
	RETVAL=$?
43
	if [ $RETVAL -eq 0 ] ; then
44
	        echo "${prog_base} stopped"
45
        	rm -f /var/lock/subsys/${prog_base}
46
	else
47
		echo
48
	fi
49
	;;
50
  status)
51
	status ${prog_base}
52
	RETVAL=$?
53
	;;
54
  restart)
55
	$0 stop
56
	$0 start
57
	RETVAL=$?
58
	;;
59
  reload)
60
	action $"Reloading ${prog_base}:" ${prog} -c ${prog_config_file} reload
61
	RETVAL=$?
62
	;;
63
  condrestart)
64
	[ -f /var/lock/subsys/${prog_base} ] && $0 restart || :
65
	RETVAL=$?
66
	;;
67
  *)
68
	echo "Usage: $0 {start|stop|status|restart|reload|condrestart}"
69
	exit 1
70
esac
71
 
72
exit $RETVAL