Start/Stop script for mailScanner

Denis Beauchemin Denis.Beauchemin at USherbrooke.ca
Thu Jun 17 16:21:18 IST 2010


Le 2010-06-17 11:00, Will Merkens a écrit :
> On 12:59 PM, Denis Beauchemin wrote:
>    
>> Will,
>>
>> Looks like a rogue sendmail. Look at the contents of
>> /var/run/sm-client.pid . It should contain 2 lines and the first one
>> should be the PID of your current clientmqueue process. If it is not
>> then that could explain why MS can't kill it since it looks in that
>> file for the PID.
>>      
> Ok
>
> first
>
> ps ax | grep send
>
> [root at gateway mail]# ps ax | grep send
>   3402 ?        Ss     0:03 sendmail: accepting
> connections
>
>   3406 ?        Ss     0:00 sendmail: Queue runner at 00:15:00 for
> /var/spool/clientmqueue
>   3414 ?        Ss     0:00 sendmail: Queue runner at 00:15:00 for
> /var/spool/mqueue
> 29215 pts/5    S+     0:00 grep --color send
>
> look at the /var/run directory
>
> [root at gateway mail]# ls -lad /var/run/s*
> drwxr-xr-x 2 root  root    6 2010-03-11 20:00 /var/run/samba/
> -rw------- 1 root  mail  150 2010-06-15 15:39 /var/run/sendmail.in.pid
> -rw------- 1 root  mail   66 2010-06-15 15:39 /var/run/sendmail.out.pid
> -rw-r--r-- 1 smmsp smmsp   0 2010-06-15 15:39 /var/run/sm-client.pid
> -rw------- 1 root  root    5 2010-04-13 12:08 /var/run/sm-notify.pid
> -rw-r--r-- 1 root  root    5 2010-04-13 12:08 /var/run/sshd.pid
> drwx------ 4 root  root   54 2010-04-17 05:02 /var/run/sudo/
> -rw------- 1 root  root    4 2010-04-13 12:08 /var/run/syslogd.pid
>
>
> I see four pid files related to sendmail.
>
>
> if I cat them
>
> [root at gateway mail]# cat /var/run/sendmail.in.pid
> 3402
> /usr/sbin/sendmail -bd -OPrivacyOptions=noetrn -ODeliveryMode=queueonly
> -OQueueDirectory=/var/spool/mqueue.in -OPidFile=/var/run/sendmail.in.pid
>
> [root at gateway mail]# cat /var/run/sendmail.out.pid
> 3414
> /usr/sbin/sendmail -q15m -OPidFile=/var/run/sendmail.out.pid
>
> [root at gateway mail]# cat /var/run/sm-client.pid
>
> [root at gateway mail]# cat /var/run/sm-notify.pid
> 2422
>
> sm-client is empty and sm-notify contains a pid that does not exist
>
> [root at gateway mail]# ps ax | grep 2422
> 29384 pts/5    D+     0:00 grep --color 2422
>
> should not the sm-client contain pid 3406 and it looks like it should
> what generates this file?
>
> if it's a malfunction start/stop script can it be fixed and where do I
> go hunting?
>
>    

Will,

The folliwing code is executed by "service MailScanner start" to start 
your clientmqueue sendmail process:
         touch /var/run/sm-client.pid
         chown $MSPUSER:$MSPGROUP /var/run/sm-client.pid 2>/dev/null
         $SENDMAIL -L sm-msp-queue -Ac -q15m -OPidFile=$SMPID 2>/dev/null

You can modify the script to get some debugging (modify the lines in 
/etc/init.d/MailScanner):
         touch /var/run/sm-client.pid
         chown $MSPUSER:$MSPGROUP /var/run/sm-client.pid
         $SENDMAIL -L sm-msp-queue -Ac -q15m -OPidFile=$SMPID

Now do "service MailScanner stop", kill your remaining sendmail process 
and do "service MailScanner start". If there are any error messages when 
starting your sendmail process they should now appear on your terminal.

I am guessing your smmsp user does not have access to your /var/run 
directory.

Denis

-- 
Denis Beauchemin, analyste
Université de Sherbrooke, S.T.I.
T: 819.821.8000x62252 F: 819.821.8045



More information about the MailScanner mailing list