Subversion Repositories ALCASAR

Rev

Rev 489 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 489 Rev 1005
Line 10... Line 10...
10
# Type havp --help for help and read havp.config you should have received.
10
# Type havp --help for help and read havp.config you should have received.
11
# chkconfig: 2345 11 89
11
# chkconfig: 2345 11 89
12
# description: starts HAVP the High Availability Antivirus Proxy
12
# description: starts HAVP the High Availability Antivirus Proxy
13
#
13
#
14
 
14
 
15
 
-
 
16
 
-
 
17
 
-
 
18
. /etc/init.d/functions
15
. /etc/init.d/functions
19
HAVP_BIN=/usr/sbin/havp
16
HAVP_BIN=/usr/sbin/havp
20
HAVP_CONFIG=/etc/havp/havp.config
17
HAVP_CONFIG=/etc/havp/havp.config
21
PIDFILE=/var/run/havp/havp.pid
18
PIDFILE=/var/run/havp/havp.pid
22
NAME=havp
19
NAME=havp
Line 68... Line 65...
68
	exit 0
65
	exit 0
69
}
66
}
70
 
67
 
71
case "$1" in
68
case "$1" in
72
	start)
69
	start)
73
	        if ! [ "`mount | grep ^$havp_loopback`" ]; then
70
	        if ! [ "`mount | grep $havp_mountpoint`" ]; then
74
			echo -n "Mounting $havp_loopback under $havp_mountpoint ..."
71
			echo -n "Mounting $havp_loopback under $havp_mountpoint ..."
75
			mount -t tmpfs -o mand,noatime,size=50m,nosuid,noexec $havp_loopback $havp_mountpoint
72
			mount -t tmpfs -o mand,noatime,size=50m,nosuid,noexec $havp_loopback $havp_mountpoint
76
			chown -R havp:havp $havp_mountpoint
73
			chown -R havp:havp $havp_mountpoint
77
			echo "done"
74
			echo "done"
78
	        fi
75
	        fi
-
 
76
	        if [ "`mount | grep $havp_mountpoint`" ]; then
79
		echo -n "Cleaning up $havp_mountpoint"...
77
			echo -n "Cleaning up $havp_mountpoint"...
80
		find $havp_mountpoint/ -type f -delete
78
			find $havp_mountpoint/ -type f -delete
81
		echo " done"
79
			echo " done"
82
		echo -n "Starting $DESC: "
80
			echo -n "Starting $DESC: "
83
		if [ ! -f $HAVP_BIN ]; then
81
			if [ ! -f $HAVP_BIN ]; then
84
			echo "Error: $HAVP_BIN not found"
82
				echo "Error: $HAVP_BIN not found"
85
			exit 5
83
				exit 5
-
 
84
			fi
-
 
85
			$HAVP_BIN -c $HAVP_CONFIG
-
 
86
		else
-
 
87
		       echo "Error: mount tmpfs point failed"
86
		fi
88
		fi
87
		$HAVP_BIN -c $HAVP_CONFIG
-
 
88
		exit $?
89
		exit $?
89
		;;
90
		;;
90
 
91
 
91
	stop)
92
	stop)
92
		echo "Shutting down $NAME ..."
93
		echo "Shutting down $NAME ..."
Line 103... Line 104...
103
			fi
104
			fi
104
		else
105
		else
105
			echo "Error: HAVP not running or PIDFILE unreadable"
106
			echo "Error: HAVP not running or PIDFILE unreadable"
106
			exit 1
107
			exit 1
107
		fi
108
		fi
-
 
109
	        if [ "`mount | grep $havp_mountpoint`" ]; then
108
		echo -n "Cleaning up $havp_mountpoint"...
110
			echo -n "Cleaning up $havp_mountpoint"...
109
		find $havp_mountpoint/ -type f -delete
111
			find $havp_mountpoint/ -type f -delete
110
		echo " done"
112
			echo " done"
111
		
-
 
112
	        if [ x"$USE_LOOPBACK" = x"true" ] && [ "`mount | grep ^$havp_loopback`" ]; then
-
 
113
			echo -n "Unmounting $havp_mountpoint ..."
113
			echo -n "Unmounting $havp_mountpoint ..."
114
			umount $havp_mountpoint
114
			umount $havp_mountpoint
115
			echo "done"
115
			echo "done"
116
	        fi
116
	        fi
117
		exit 0
117
		exit 0