True64 Unix changes to check_mailscanner
Nick Phillips
nwp at LEMON-COMPUTING.COM
Wed Aug 7 19:52:30 IST 2002
On Wed, Aug 07, 2002 at 11:07:17AM -0400, Joshua Baron wrote:
> then the examples included in the file. If the developers read over this
> maybe they will include this within thier check_mailscanner file, for the
> True64 users of thier product. As we make modifications for our
> environment i may post other changes we make.
I've actually already made a bunch of changes to check_mailscanner, but
they are only currently used if you use the auto-installer.
We don't currently ship the auto-installer, as Jules hasn't got round to
using it yet, and we were going to put it in version 4. However, since it
seems that version 4 is going to be a complete rewrite and will take a while.
I guess we should/could consider putting it out sooner than that.
(I'd like to anyway cos I wrote it and it feels like it's going to go to
waste otherwise ;) )
In the meantime, could you possibly check whether the attached
check_mailscanner.in, when renamed to check_mailscanner and suitably edited
to replace the autoconf placeholders (@something@), works on Tru64?
Cheers,
Nick
--
Nick Phillips -- nwp at lemon-computing.com
Your love life will be... interesting.
-------------- next part --------------
#!/bin/sh
#
# check_mailscanner
#
# $Id: check_mailscanner.in,v 1.2 2002/05/29 07:08:00 nwp Exp $
#
# Script to check whether mailscanner process is running, and
# start it up if not.
#
# Copyright (C) 2002 Julian Field, Nick Phillips
#
# This program 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 program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# The author, Julian Field, can be contacted by email at
# Jules at JulianField.net
# or by paper mail at
# Julian Field
# Dept of Electronics & Computer Science
# University of Southampton
# Southampton
# SO17 1BJ
# United Kingdom
#
# Check that the virus scanner is still running.
# Re-start it if necessary.
# This can also be used from the init script to
# start it in the first place.
process=mailscanner
virusdir=@sbindir@
config=@sysconfdir@/mailscanner.conf
# These seem to get put all over the shop...
AWK=@AWK@
GREP=@GREP@
# ...but surely everyone has these in /bin?
PS=/bin/ps
UNAME=/bin/uname
if test -z `$UNAME | $GREP BSD` ; then
# not BSD; everything else seems to do POSIX
pid=`COLUMNS=500 $PS -ef | $GREP '[ ]'$virusdir/$process | $AWK '{print $2}'`
else
# (Open|Free|Net)BSD
pid=`$PS -axww | $GREP '[ ]'$virusdir/$process | $AWK '{print $1}'`
fi
if [ "$pid" = "" ]; then
# Restart it
PATH=${virusdir}:$PATH
echo Starting virus scanner...
$process $config
else
echo Running with pid $pid
fi
More information about the MailScanner
mailing list