Re: spamd-setup fails from cron

2012-06-04 Thread David Diggles
Ok; After running that a few days, it works fine, but... the interval between updates is all over the place. I rewrote it, to only change the sleep value under 2 circumstances: First time run, or after a failure. Now it's updating hourly again. I will not make the same mistake of posting it t

Re: spamd-setup fails from cron

2012-05-31 Thread David Diggles
> #!/bin/sh > remaining=$1;shift > cmd=$@ > lock=/var/run/$(basename $1).lock > [ -f $lock ] || { > touch $lock > while [ $remaining -gt 0 ]; do > seconds=$(($RANDOM % $remaining)) > echo $(date) $seconds >> $lock > sleep $seconds > $cmd && return || remaining=$(($remaining - $s

Re: spamd-setup fails from cron

2012-05-31 Thread David Diggles
On Fri, Jun 01, 2012 at 03:47:21PM +1000, David Diggles wrote: [ snip ] > sleep $s [ snip ] Arghh.. ;-) sleep $seconds here Anyway, you get the idea. #!/bin/sh remaining=$1;shift cmd=$@ lock=/var/run/$(basename $1).lock [ -f $lock ] || { touch $lock while [ $remaining -gt 0 ]; do sec

Re: spamd-setup fails from cron

2012-05-31 Thread David Diggles
On Tue, May 29, 2012 at 09:51:54AM +0200, Bret Lambert wrote: > > Please avoid 15 minutes past the hour ;-) > > sleep $(($RANDOM % 2048)) && /usr/libexec/spamd-setup -d Tried something like the above, and found it still fails at peak times, so I am trying something else: I made a wrapper called

Re: spamd-setup fails from cron

2012-05-29 Thread Jan Stary
On May 29 09:14:29, Peter N. M. Hansteen wrote: > On Tue, May 29, 2012 at 08:24:07AM +0200, Jan Stary wrote: > > > When I run the same command from the command line, > > everything goes fine. Is the cron job run in a more > > restricted environment? > > you could be hitting the 'zero minute rush

Re: spamd-setup fails from cron

2012-05-29 Thread Christer Solskogen
On Tue, May 29, 2012 at 9:50 AM, Mitja MuE>eniD wrote: > Years ago I've been toying with the idea of having a flag for random-delay > mode in spamd-setup. So the default cronjob is still set at zero minute, but > spamd-setup then waits for random amount of minutes before hitting the > server. You

Re: spamd-setup fails from cron

2012-05-29 Thread Mitja Muženič
> > you could be hitting the 'zero minute rush', where world+dog tries to > > connect simultaneously. try shifting to a few minutes past the hour > and > > see if that helps. > > > > Please avoid 15 minutes past the hour ;-) Years ago I've been toying with the idea of having a flag for random-de

Re: spamd-setup fails from cron

2012-05-29 Thread Bret Lambert
> Please avoid 15 minutes past the hour ;-) sleep $(($RANDOM % 2048)) && /usr/libexec/spamd-setup -d

Re: spamd-setup fails from cron

2012-05-29 Thread David Diggles
A random sleep between 0 and 3599 prior to running spamd-setup in cron would not go astray. On Tue, May 29, 2012 at 09:23:43AM +0200, Gilles Chehade wrote: > On Tue, May 29, 2012 at 09:14:29AM +0200, Peter N. M. Hansteen wrote: > > On Tue, May 29, 2012 at 08:24:07AM +0200, Jan Stary wrote: > > >

Re: spamd-setup fails from cron

2012-05-29 Thread Gilles Chehade
On Tue, May 29, 2012 at 09:14:29AM +0200, Peter N. M. Hansteen wrote: > On Tue, May 29, 2012 at 08:24:07AM +0200, Jan Stary wrote: > > > When I run the same command from the command line, > > everything goes fine. Is the cron job run in a more > > restricted environment? > > you could be hitting

Re: spamd-setup fails from cron

2012-05-29 Thread Peter N. M. Hansteen
On Tue, May 29, 2012 at 08:24:07AM +0200, Jan Stary wrote: > When I run the same command from the command line, > everything goes fine. Is the cron job run in a more > restricted environment? you could be hitting the 'zero minute rush', where world+dog tries to connect simultaneously. try shif

Re: spamd-setup fails from cron

2012-05-28 Thread David Diggles
Change it to this: * * * * /usr/libexec/spamd-setup -d It will probably fix the problem. On Tue, May 29, 2012 at 08:24:07AM +0200, Jan Stary wrote: > Pretty current 5.1-current/amd64. > This is what happens with the following line in root's crontab > > 0 * * * * /usr/libexec/spamd-setup

spamd-setup fails from cron

2012-05-28 Thread Jan Stary
Pretty current 5.1-current/amd64. This is what happens with the following line in root's crontab 0 * * * * /usr/libexec/spamd-setup -d On May 29 03:00:02, Cron Daemon wrote: > Getting http://www.openbsd.org/spamd/traplist.gz > spamd-setup: Could not add blacklist uatraps: Illegal seek > G