RH init script

Denis Beauchemin Denis.Beauchemin at USherbrooke.ca
Sat Feb 28 23:27:57 GMT 2009


Julian Field a écrit :
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Why not just kill the mspid, and not killproc MailScanner?
>
> On 27/2/09 20:05, Denis Beauchemin wrote:
>   
>> Julian Field a écrit :
>>     
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>>
>>>
>>>
>>> On 27/2/09 15:05, Denis Beauchemin wrote:
>>>       
>>>> PS: I am trying to configure a server that could (in case of DR) 
>>>> play both inbound and outbound roles at the same time.  I will be 
>>>> running different sendmail and MS instances.  I think the current 
>>>> init script won't play nice with this scheme because it "killproc 
>>>> MailScanner" without regards about which instance it might belong 
>>>> to. Why don't you use $MSPID instead?
>>>>         
>>> Err... because I started by copying someone else's init.d script! I 
>>> ideally want to send the TERM to the child processes as well, though, 
>>> so they all get told to start dying.
>>>
>>> Jules
>>>       
>> Julian,
>>
>> In the RH init script, could you replace all "killproc MailScanner 
>> -15" by:
>>        if [[ -s $MSPID ]]; then
>>          kill -15 $(ps -ef|grep $(cat /var/run/MailScanner.pid)|awk 
>> '/MailScanner:/{print $2}')
>>        else
>>          killproc MailScanner -15
>>        fi
>>
>> That way you'll kill all MS children at the same time without killing 
>> other MS processess started by a different instance of MS.
>>
>> There are so many things I have to modify in so many different files 
>> to be able to run many MS instances simultaneously on the same machine 
>> that I may as well rewrite the init.d script altogether...
>>
>> Thanks!
>>
>> Denis
>>
>>     
>
> Jules
>   

Julian,

That would be fine with me, but you wouldn't be killing all children at 
the same time that way.

Denis

-- 
   _
  °v°   Denis Beauchemin, analyste
 /(_)\  Université de Sherbrooke, S.T.I.
  ^ ^   T: 819.821.8000x62252 F: 819.821.8045



More information about the MailScanner mailing list