2840 |
rexy |
1 |
havp_loopback=tmpfs
|
|
|
2 |
havp_mountpoint=/var/tmp/havp
|
|
|
3 |
|
|
|
4 |
#set -e
|
|
|
5 |
|
|
|
6 |
# Return values acc. to LSB for all commands but status:
|
|
|
7 |
# 1 generic or unspecified error (current practice)
|
|
|
8 |
# 2 invalid or excess argument(s)
|
|
|
9 |
# 3 unimplemented feature (for example, "reload")
|
|
|
10 |
# 4 user had insufficient privilege
|
|
|
11 |
# 5 program is not installed
|
|
|
12 |
# 6 program is not configured
|
|
|
13 |
# 7 program is not running
|
|
|
14 |
# 8-99 reserved for future LSB use
|
|
|
15 |
# 100-149 reserved for distribution use
|
|
|
16 |
# 150-199 reserved for application use
|
|
|
17 |
# 200-254 reserved
|
|
|
18 |
# Note that starting an already running service, stopping
|
|
|
19 |
# or restarting a not-running service as well as the restart
|
|
|
20 |
# with force-reload (in case signaling is not supported) are
|
|
|
21 |
# considered a success.
|
|
|
22 |
|
|
|
23 |
start)
|
|
|
24 |
if ! [ "`mount | grep $havp_mountpoint`" ]; then
|
|
|
25 |
echo -n "Mounting $havp_loopback under $havp_mountpoint ..."
|
|
|
26 |
mount -t tmpfs -o mand,noatime,size=50m,nosuid,noexec $havp_loopback $havp_mountpoint
|
|
|
27 |
chown -R havp:havp $havp_mountpoint
|
|
|
28 |
echo "done"
|
|
|
29 |
fi
|
|
|
30 |
if [ "`mount | grep $havp_mountpoint`" ]; then
|
|
|
31 |
echo -n "Cleaning up $havp_mountpoint"...
|
|
|
32 |
find $havp_mountpoint/ -type f -delete
|
|
|
33 |
echo " done"
|
|
|
34 |
echo -n "Starting $DESC: "
|
|
|
35 |
if [ ! -f $HAVP_BIN ]; then
|
|
|
36 |
echo "Error: $HAVP_BIN not found"
|
|
|
37 |
exit 5
|
|
|
38 |
fi
|
|
|
39 |
$HAVP_BIN -c $HAVP_CONFIG
|
|
|
40 |
else
|
|
|
41 |
echo "Error: mount tmpfs point failed"
|
|
|
42 |
fi
|
|
|
43 |
chmod 644 /var/log/havp/access.log
|
|
|
44 |
exit $?
|
|
|
45 |
;;
|