Re: while-loop not sleepy enough

From: Kevin Collins (spamtotrash@toomuchfiction.com)
Date: 04/18/03


From: spamtotrash@toomuchfiction.com (Kevin Collins)
Date: 18 Apr 2003 14:18:00 -0700


"Dr. Yuan Liu" <yliu@stemnet.nf.ca.remove_this> wrote in message news:<3E9FD1AB.6090003@stemnet.nf.ca.remove_this>...
> Hartmut Gehrke-Tschudi wrote:
> [snip]
> >>wait, until (pid_of_)spamassassin
> >>has diappeared, i.e.
> >
> > 1. how do I get those pids? Donīt forget every Mail gets its own
> > Sa-Process.
> >
> > Sorry, could you please be more elaborate. Iīm Newbie.
> >
> >>while kill -0 pid_of_spamassassin 2>/dev/null
> [snip]
>
> It seems that you are using SysV ps; if so, `ps -e |grep
> [s]pamassassin|cut -c-6` would give you pid(s).

A SpamAssassin process launches for each mail received as it is
received - so monitoring of the pids is not a good solution because
this a multi-tasked operation.

I perform similar stuff with fetchmail and SpamAssassin and I can't
think of any sensible way to do what you are trying to do. I have
never seen SA take any real amount of time to check a message, so I
wouldn't worry too much about it.

If I were doing this, I might use the output of fetchmail to indicate
thenumber of messages received and then add a fixed amount of sleep
for each message. For example, if I received 3 messages, I'd sleep for
3 seconds...

Kevin