<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>

<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN class=730065009-29102002><FONT face=Arial color=#0000ff size=2>could 
you just make it a bit clearer for me please - where exactly did you insert this 
in below - do you replace the current #next try pidof ? - I'm using a dev box 
but its easier to get it right first time :-)</FONT></SPAN></DIV>
<DIV><SPAN class=730065009-29102002><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=730065009-29102002><FONT face=Arial color=#0000ff size=2>Thanks 
Gavin</FONT></SPAN></DIV>
<DIV><SPAN class=730065009-29102002><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=730065009-29102002><FONT face=Arial color=#0000ff size=2># A 
function to find the pid of a program.<BR>pidofproc() 
{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Test 
syntax.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if [ $# = 0 ] ; 
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
echo "Usage: pidofproc 
{program}"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
return 1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
fi<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs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p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
(("[" prog "]") == $5) 
||<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
((prog ":") == $5)) { print $1 ; exit 0 } }' 
$1<BR>}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</FONT></SPAN></DIV>
<BLOCKQUOTE 
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
  <DIV></DIV>
  <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT 
  face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> MailScanner 
  mailing list [mailto:MAILSCANNER@JISCMAIL.AC.UK] <B>On Behalf Of </B>Paul 
  Houselander<BR><B>Sent:</B> 29 October 2002 08:48<BR><B>To:</B> 
  MAILSCANNER@JISCMAIL.AC.UK<BR><B>Subject:</B> Re: Directorys in 
  /var/spool/MailScanner/incoming<BR><BR></FONT></DIV>
  <DIV><FONT face=Arial size=2>My initial question did not relate to a cobalt, 
  but I do have access to a Raq4&nbsp;so tried it out and have the same problem 
  with the init script not successfully stopping MailScanner, however it does 
  work fine on my RedHat 7.2 system.</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>On the cobalt, the 
  pidofproc&nbsp;function&nbsp;in /etc/rc.d/init.d/functions&nbsp;does not 
  return anything. </FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>However, after&nbsp;comparing the 
  pidofproc&nbsp;function on the cobalt and redhat systems I added (after making 
  a backup of "functions")</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>&nbsp;&nbsp; # Next try 
  "pidof"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pidof -o $$ -o $PPID -o 
  %PPID -x $1 || \<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pidof -o $$ -o 
  $PPID -o %PPID -x ${base}</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>To the pidofproc function on the cobalt, now the 
  init script works fine and is able to stop mailscanner.</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>As Cobalts are strange beasts I dont know whether 
  this is going to break anything else, but seems ok at the moment.</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Cheers</DIV>
  <DIV>&nbsp;</DIV>
  <DIV>Paul</DIV>
  <DIV>&nbsp;</DIV>
  <DIV></FONT>----- Original Message ----- </DIV>
  <BLOCKQUOTE 
  style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
    <DIV 
    style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
    <A title=gavin@NETERGY.COM href="mailto:gavin@NETERGY.COM">Gavin 
    Nelmes-Crocker</A> </DIV>
    <DIV style="FONT: 10pt arial"><B>To:</B> <A title=MAILSCANNER@JISCMAIL.AC.UK 
    href="mailto:MAILSCANNER@JISCMAIL.AC.UK">MAILSCANNER@JISCMAIL.AC.UK</A> 
    </DIV>
    <DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, October 28, 2002 5:32 
    PM</DIV>
    <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: Directorys in 
    /var/spool/MailScanner/incoming</DIV>
    <DIV><BR></DIV>
    <DIV><SPAN class=337222717-28102002><FONT face=Arial color=#0000ff 
    size=2>this also matches with mine and a a couple of others problem but on a 
    Cobalt RaQ in the the init script doesn't stop the mailscanner has the init 
    script got broken somewhere? this section seems to be related to all the 
    PIDs for mailscanner but its commented out and I couldn't find any killproc 
    info for Mailscanner in the init file - but then this bit is a bit of 
    mystery for me anyway.</FONT></SPAN></DIV>
    <DIV><SPAN class=337222717-28102002><FONT face=Arial color=#0000ff 
    size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV><SPAN class=337222717-28102002><FONT face=Arial color=#0000ff size=2>
    <DIV><SPAN class=337222717-28102002><FONT face=Arial color=#0000ff size=2># 
    Get a string of all the PIDs of MailScanner<BR>#MailScannerPids() 
    {<BR>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cd $PIDDIR || return 
    1<BR>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PIDLIST=`ls | grep 
    '^MailScanner.' | sed -e 
    's/MailScanner.//g'`<BR>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo 
    PIDLIST<BR>#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return 
    0<BR>#}</FONT></SPAN></DIV></FONT></SPAN></DIV>
    <DIV><SPAN class=337222717-28102002><FONT face=Arial color=#0000ff 
    size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV><SPAN class=337222717-28102002><FONT face=Arial color=#0000ff 
    size=2>Regards</FONT></SPAN></DIV>
    <DIV><SPAN class=337222717-28102002><FONT face=Arial color=#0000ff 
    size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV><SPAN class=337222717-28102002><FONT face=Arial color=#0000ff 
    size=2>Gavin</FONT></SPAN></DIV>
    <DIV><SPAN class=337222717-28102002><FONT face=Arial color=#0000ff size=2>ps 
    I also have a whole bunch of PIDs in /var/spool/Mailscanner which don't get 
    deleted</FONT></SPAN></DIV>
    <DIV><SPAN class=337222717-28102002><FONT face=Arial color=#0000ff 
    size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV><SPAN class=337222717-28102002><FONT face=Arial color=#0000ff 
    size=2></FONT></SPAN>&nbsp;</DIV>
    <DIV><SPAN class=337222717-28102002><FONT face=Arial color=#0000ff 
    size=2></FONT></SPAN>&nbsp;</DIV>
    <BLOCKQUOTE 
    style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
      <DIV></DIV>
      <DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left><FONT 
      face=Tahoma size=2>-----Original Message-----<BR><B>From:</B> MailScanner 
      mailing list [mailto:MAILSCANNER@JISCMAIL.AC.UK] <B>On Behalf Of </B>Paul 
      Houselander<BR><B>Sent:</B> 28 October 2002 16:50<BR><B>To:</B> 
      MAILSCANNER@JISCMAIL.AC.UK<BR><B>Subject:</B> Directorys in 
      /var/spool/MailScanner/incoming<BR><BR></FONT></DIV>
      <DIV><FONT face=Arial size=2>Im using</FONT></DIV>
      <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
      <DIV><FONT face=Arial size=2>RedHat 7.2 and the rpm MailScanner 
      4.03-1</FONT></DIV>
      <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
      <DIV><FONT face=Arial size=2>I seem to recall this being discussed but 
      cant find any previous mention of it.</FONT></DIV>
      <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
      <DIV><FONT face=Arial size=2>Directorys with the same name as the pid are 
      being created in /var/spool/MailScanner/incoming, but are not being 
      cleaned up on a restart or stop - is this as it should be?.</FONT></DIV>
      <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
      <DIV><FONT face=Arial size=2>Is their any resason I should not delete them 
      in the stop and restart parts of /etc/rc.d/init.d/MailScanner</FONT></DIV>
      <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
      <DIV><FONT face=Arial size=2>Thanks</FONT></DIV>
      <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
      <DIV><FONT face=Arial size=2>Paul</FONT></DIV>
      <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
      <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV><BR>-- <BR>This message 
      has been scanned for viruses and <BR>dangerous content by <A 
      href="http://www.mailscanner.info/"><B>MailScanner</B></A>, and 
      is<BR>believed to be clean. </BLOCKQUOTE><BR>-- <BR>This message has been 
    scanned for viruses and <BR>dangerous content by <A 
    href="http://www.mailscanner.info/"><B>MailScanner</B></A>, and 
    is<BR>believed to be clean. </BLOCKQUOTE><BR>-- <BR>This message has been 
  scanned for viruses and <BR>dangerous content by <A 
  href="http://www.mailscanner.info/"><B>MailScanner</B></A>, and is<BR>believed 
  to be clean. </BLOCKQUOTE></BODY></HTML>