Subversion Repositories ALCASAR

Compare Revisions

No changes between revisions

Regard whitespace Rev 2840 → Rev 2839

/conf/havp-tmpfs-example
File deleted
/conf/havp-init
0,0 → 1,152
#!/bin/sh
#
#
####
# This init-script tries to be LSB conform but platform independent.
#
# Therefore check the following two variables to fit to your requests:
# HAVP_BIN HAVP_CONFIG PIDFILE
# Any configuration of HAVP is done in havp.config
# Type havp --help for help and read havp.config you should have received.
# chkconfig: 2345 11 89
# description: starts HAVP the High Availability Antivirus Proxy
#
 
. /etc/init.d/functions
HAVP_BIN=/usr/sbin/havp
HAVP_CONFIG=/etc/havp/havp.config
PIDFILE=/run/havp/havp.pid
NAME=havp
DESC=havp
 
test -x $HAVP_BIN || exit 0
 
# Include havp defaults if available
if [ -f /etc/sysconfig/havp ] ; then
. /etc/sysconfig/havp
fi
 
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.
 
reload_havp()
{
echo "Reloading HAVP ..."
PID="`cat $PIDFILE`"
if [ "$PID" != "" ]; then
kill -HUP "$PID" >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Error: HAVP not running"
exit 1
fi
else
echo "Error: HAVP not running or PIDFILE not readable"
exit 1
fi
exit 0
}
 
case "$1" in
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 $?
;;
 
stop)
echo "Shutting down $NAME ..."
if [ ! -f "$PIDFILE" ]; then
echo "Error: HAVP not running or PIDFILE unreadable"
exit 1
fi
PID="`cat $PIDFILE`"
if [ "$PID" != "" ]; then
kill -TERM "$PID" >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Error: HAVP not running"
exit 1
fi
else
echo "Error: HAVP not running or PIDFILE unreadable"
exit 1
fi
if [ "`mount | grep $havp_mountpoint`" ]; then
echo -n "Cleaning up $havp_mountpoint"...
find $havp_mountpoint/ -type f -delete
echo " done"
echo -n "Unmounting $havp_mountpoint ..."
umount $havp_mountpoint
echo "done"
fi
exit 0
;;
 
restart)
echo "Shutting down HAVP ..."
$0 stop >/dev/null 2>&1
$0 start
exit $?
;;
 
reload-lists)
reload_havp
;;
 
force-reload)
reload_havp
;;
 
reload)
reload_havp
;;
 
status)
status havp
exit 4
;;
 
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|status|restart|force-reload|reload|reload-lists}"
exit 0
;;
esac
 
exit 0
Property changes:
Added: svn:executable
+*
\ No newline at end of property
Added: svn:keywords
+Id Date Author
\ No newline at end of property
/conf/havp.service
0,0 → 1,25
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This unit launches HAVP
[Unit]
Description=HAVP
After=network.target
 
[Service]
RemainAfterExit=yes
ExecStartPre=/bin/mkdir -p /run/havp
ExecStartPre=/bin/chown -R havp:havp /run/havp /var/log/havp
ExecStartPre=/bin/mkdir -p /run/havp
ExecStartPre=/bin/chown -R havp:havp /run/havp /var/log/havp
PIDFile=/run/havp/havp.pid
ExecStart=/etc/init.d/havp start
ExecStop=/etc/init.d/havp stop
ExecReload=/etc/init.d/havp restart
 
[Install]
WantedBy=multi-user.target