0,0 → 1,45 |
havp_loopback=tmpfs |
havp_mountpoint=/var/tmp/havp |
|
#set -e |
|
# Return values acc. to LSB for all commands but status: |
# 1 generic or unspecified error (current practice) |
# 2 invalid or excess argument(s) |
# 3 unimplemented feature (for example, "reload") |
# 4 user had insufficient privilege |
# 5 program is not installed |
# 6 program is not configured |
# 7 program is not running |
# 8-99 reserved for future LSB use |
# 100-149 reserved for distribution use |
# 150-199 reserved for application use |
# 200-254 reserved |
# Note that starting an already running service, stopping |
# or restarting a not-running service as well as the restart |
# with force-reload (in case signaling is not supported) are |
# considered a success. |
|
start) |
if ! [ "`mount | grep $havp_mountpoint`" ]; then |
echo -n "Mounting $havp_loopback under $havp_mountpoint ..." |
mount -t tmpfs -o mand,noatime,size=50m,nosuid,noexec $havp_loopback $havp_mountpoint |
chown -R havp:havp $havp_mountpoint |
echo "done" |
fi |
if [ "`mount | grep $havp_mountpoint`" ]; then |
echo -n "Cleaning up $havp_mountpoint"... |
find $havp_mountpoint/ -type f -delete |
echo " done" |
echo -n "Starting $DESC: " |
if [ ! -f $HAVP_BIN ]; then |
echo "Error: $HAVP_BIN not found" |
exit 5 |
fi |
$HAVP_BIN -c $HAVP_CONFIG |
else |
echo "Error: mount tmpfs point failed" |
fi |
chmod 644 /var/log/havp/access.log |
exit $? |
;; |