Subversion Repositories ALCASAR

Rev

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

Rev 480 Rev 482
Line 1... Line 1...
1
#!/bin/sh
1
#!/bin/sh
2
#
2
#
3
# $Id: havp-init 480 2011-02-08 22:51:57Z franck $
-
 
-
 
3
#
4
####
4
####
5
# This init-script tries to be LSB conform but platform independent.
5
# This init-script tries to be LSB conform but platform independent.
6
# 
6
# 
7
# Therefore check the following two variables to fit to your requests:
7
# Therefore check the following two variables to fit to your requests:
8
# HAVP_BIN HAVP_CONFIG PIDFILE
8
# HAVP_BIN HAVP_CONFIG PIDFILE
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
 
15
. /etc/init.d/functions
18
. /etc/init.d/functions
16
HAVP_BIN=/usr/sbin/havp
19
HAVP_BIN=/usr/sbin/havp
17
HAVP_CONFIG=/etc/havp/havp.config
20
HAVP_CONFIG=/etc/havp/havp.config
18
PIDFILE=/var/run/havp/havp.pid
21
PIDFILE=/var/run/havp/havp.pid
19
NAME=havp
22
NAME=havp
Line 24... Line 27...
24
# Include havp defaults if available
27
# Include havp defaults if available
25
if [ -f /etc/sysconfig/havp ] ; then
28
if [ -f /etc/sysconfig/havp ] ; then
26
	. /etc/sysconfig/havp
29
	. /etc/sysconfig/havp
27
fi
30
fi
28
 
31
 
29
havp_loopback=/var/lib/havp/havp.loop
32
havp_loopback=tmpfs
30
havp_mountpoint=/var/tmp/havp
33
havp_mountpoint=/var/tmp/havp
31
 
34
 
32
#set -e
35
#set -e
33
 
36
 
34
# Return values acc. to LSB for all commands but status:
37
# Return values acc. to LSB for all commands but status:
Line 65... Line 68...
65
	exit 0
68
	exit 0
66
}
69
}
67
 
70
 
68
case "$1" in
71
case "$1" in
69
	start)
72
	start)
70
	        if [ x"$USE_LOOPBACK" = x"true" -a -e $havp_loopback ] && \
73
	        if [ x"$USE_LOOPBACK" = x"true" ] &&  ! [ "`mount | grep ^$havp_loopback`" ]; then
71
		   ! [ "`mount | grep ^$havp_loopback`" ]; then
-
 
72
			echo -n "Mounting $havp_loopback under $havp_mountpoint ..."
74
			echo -n "Mounting $havp_loopback under $havp_mountpoint ..."
73
			mount  -o rw,mand,loop,noatime,async  $havp_loopback $havp_mountpoint
75
			mount -t tmpfs -o mand,noatime,size=50m,nosuid,noexec $havp_loopback $havp_mountpoint
74
			chown -R havp:havp $havp_mountpoint
76
			chown -R havp:havp $havp_mountpoint
75
			echo "done"
77
			echo "done"
76
	        fi
78
	        fi
77
		echo -n "Cleaning up $havp_mountpoint"...
79
		echo -n "Cleaning up $havp_mountpoint"...
78
		find $havp_mountpoint/ -type f -delete
80
		find $havp_mountpoint/ -type f -delete
Line 105... Line 107...
105
		fi
107
		fi
106
		echo -n "Cleaning up $havp_mountpoint"...
108
		echo -n "Cleaning up $havp_mountpoint"...
107
		find $havp_mountpoint/ -type f -delete
109
		find $havp_mountpoint/ -type f -delete
108
		echo " done"
110
		echo " done"
109
		
111
		
110
		sleep 2
-
 
111
	        if [ x"$USE_LOOPBACK" = x"true" ] && [ "`mount | grep ^$havp_loopback`" ]; then
112
	        if [ x"$USE_LOOPBACK" = x"true" ] && [ "`mount | grep ^$havp_loopback`" ]; then
112
			echo -n "Unmounting $havp_mountpoint ..."
113
			echo -n "Unmounting $havp_mountpoint ..."
113
			umount $havp_mountpoint
114
			umount $havp_mountpoint
114
			echo "done"
115
			echo "done"
115
	        fi
116
	        fi