Autor: Iain Price Data: A: Nico Erfurth CC: exim-users Assumpte: Re: [Exim] Small change to exiwhat
Nico Erfurth wrote: > Iain Price wrote:
>
>> Anyway, anti commercial unix stuff aside, I think the only portable way
>> is to use something like "kill `ps -ef|grep <process>|grep -v grep|cut
>> -c10-15 `". Horrible innit (the cut statement is wrong too, check what
>> the formatting is, and test it before you implement it on a platform :D
>
>
> This is nearly the way exiwhat is using now, but that's a
> race-condition. Exim's processes appear and disappear too fast, to make
> this really work. You will get some strange error messages all the time,
> because the process you want to kill is already gone. Or, the worst
> case, another process with the same PID has spawned in the mean time,
> and that receives the signal. You don't want to send SIGUSR1 to some
> random process I think ;)
True, but i think *all* unix implements process numbers as an increasing
wrapping number, 16 bit (signed?). Anyway, if signed, you would have to
have some ten thousand processes start and die per second for this to be
an issue :D
(mathematically, it depends on the number of 'static' processes you have
that dont die, so if you have 32760 backgrounded copies of 'cat'
sleeping away, then yeah, you need '7' processes a second before this
becomes a problem :P) I guess, keep your process counts below 50% max?
Dont have enough experience of huge systems to know if this is ever a
problem :)
[the 'master daemon' idea in my other mail is much better than killall
anyway :]