Two minor fixes?
shuttlebox
shuttlebox at gmail.com
Mon Sep 3 16:18:30 IST 2007
I have some small problems I would like looked at if possible. First
is the method of finding out the PID of MS in the check_mailscanner
script. It doesn't always work in Solaris since the output gets
truncated and depending on your path the whole string MailScanner
might not be available. This is what happens on Blastwave installs,
the path doesn't contain MailScanner with uppercase M and S and the
process itself gets truncated:
# ps -ef | grep Mail
root 8174 1 0 15:38:34 ? 0:00 /opt/csw/bin/perl
-I/opt/csw/mailscanner/lib /opt/csw/mailscanner/bin/MailScann
# /usr/ucb/ps auxww | egrep
/opt/csw/mailscanner/bin/MailScanner'|'MailScanner'[:]' | grep -v grep
| awk '{print $2}'
# pgrep MailScanner
8174
Note that the first method returns nothing but pgrep works fine. I
would suggest this simpler method, pgrep has been around since at
least Solaris 8 so it should be safe to use:
--- check_mailscanner Wed Aug 15 11:09:25 2007
+++ check_mailscanner.orig Wed Aug 15 11:20:29 2007
@@ -54,4 +54,5 @@
FGREP=fgrep
EGREP=egrep
+PGREP=pgrep
PS=ps
UNAME='uname -a'
@@ -71,8 +72,5 @@
if $UNAME | $FGREP "SunOS" >/dev/null ; then
# Version for Solaris/SysV systems:
- pid=`/usr/ucb/ps auxww |
- egrep $msbindir/$process'|'$process'[:]' |
- grep -v grep |
- awk '{print $2}'`
+ pid=`$PGREP $process`
elif $UNAME | $FGREP "HP" >/dev/null ; then
# Version for HP-UX
The next one (also minor) is about Perl modules when running
MailScanner -v. Date::Parse (TimeDate) seems to be required but it's
not listed at all.
--
/peter
More information about the MailScanner
mailing list