From: Peter H. Lemieux [mailto:[EMAIL PROTECTED]
> Giampaolo Tomassoni wrote:
> >         # Check for amavis termination
> >         while [[ ! -z "${PIDS}" ]]; do
> >                 sleep 1
> >                 PIDS=$( /sbin/pidof "${AMV_NM}" )
> >         done
> 
> In cases like this I usually just put the "sleep" command in the init 
> script like this:
> 
> ...
> 
> case "$1" in
> ...
> 
>    restart|reload)
>          stop
>       sleep 5  <=====
>          start
>          RETVAL=$?
>          ;;
> 
> ...
> 
> I'm not a gentoo user, though, so YMMV.  I'm using RedHat/CentOS.  Still 
> I'd bet the init scripts aren't that different.

The init script fails because it uses something like your way: a single sleep 5 
:)

The guy who made the script did simply test shutting and restarting the 
amavis/spamd daemon up and down in its own test environment, which basicly is 
low mail load or even no mail at all.

After a while amavis is doing it's dirty job, I noticed it needs a lot of time 
to shut down. It takes to me something around 10 secs in the average and 
sometimes it takes even more. So, a 'sleep 5' simply wouldn't fit.

I don't know why (and I even don't care to know), but the script I'm using 
introduces a delay of at most 1 more sec than the strictly needed in restarting 
amavis and it never failed to me.

Giampaolo


> 
> Peter

Reply via email to