[Avcheck] kavdaemon init Skript
Piotr Klaban
makler@man.torun.pl
Tue, 28 Aug 2001 19:29:53 +0200
On Wed, Aug 15, 2001 at 02:39:43PM +0200, Geir Thomassen wrote:
> #!/bin/sh
> #
> # startup/shutdown script for kavdaemon for use with avpcheck.
> #
> # chkconfig: 2345 78 32
> # description: kavdaemon is virus scanner used by avcheck \
> # for the postfix mail system.
> #
This is the contents my old linux redhat avp daemon starting script.
DO NOT USE it as is - this file need to be changed in order
to be used by the new kavdaemon, because this script is for
the old AvpDaemon test edition. Below this script I have enclosed
my current simple script for Solaris - simple, and just works.
#!/bin/sh
#
# avpdaemon Starts Virus Checking Daemon
#
# chkconfig: 2345 80 30
# description: AVP daemon starts avp daemon
# processname: avpd
#
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -f /usr/local/avp/AvpDaemon ] || exit 0
# See how we were called.
case "$1" in
start)
# Start daemons.
#ulimit -t 70
echo -n "Starting AvpDaemon: "
echo "" | /bin/nice -n 20 /var/spool/avp/bin/uchroot \
-u avpd /var/spool/avp \
./AvpDaemon -Z /tst > /dev/null 2>&1
if [ $? = 0 ] ; then
echo_success
else
echo_failure
fi
echo
touch /var/lock/subsys/avpdaemon
;;
stop)
# Stop daemons.
echo -n "Shutting down AvpDaemon: "
/var/spool/avp/bin/uchroot -u avpd /var/spool/avp \
./AvpDaemon -k > /dev/null 2>&1
if [ $? = 0 ] ; then
echo_success
else
echo_failure
fi
echo
;;
restart)
/bin/sh $0 stop
/bin/sh $0 start
;;
*)
echo "Usage: avpdaemon {start|stop|restart}"
exit 1
esac
exit 0
========
This is solaris version:
#!/bin/sh
#
# Date: Aug 22 2001
# Author: Piotr Klaban <makler@man.torun.pl>
#
# License: public domain
#
case "$1" in
'start')
if [ -f /var/spool/avp/uchroot ]; then
/usr/bin/env - HOME=/ \
/usr/bin/nice \
/var/spool/avp/uchroot -u avpd /var/spool/avp \
./kavdaemon -dl -f=/ctl /tst > /dev/null
echo "AVP daemon started"
fi
;;
'stop')
if [ -f /var/spool/avp/ctl/AvpPid ]; then
/usr/bin/env - HOME=/ \
/usr/bin/nice \
/var/spool/avp/uchroot -u avpd /var/spool/avp \
./kavdaemon -k -f=/ctl
echo "AVP daemon stopped"
fi
;;
*)
echo "Usage: /etc/init.d/avpd { start | stop }"
;;
esac
exit 0
=======
Best regards,
--
Piotr Klaban