Package: spamassassin
Version: 3.4.0-1
Severity: wishlist
Tags: patch

The recent debugging made me wish for an improvement to the
/etc/cron.daily/spamassassin script.  Currently it sleeps a random
time so that all of the clients do not all start at once.

  RANGE=3600
  number=`od -vAn -N2 -tu4 < /dev/urandom`
  number=`expr $number "%" $RANGE`
  sleep $number

But this is inconvenient when when trying to debug the script
interactively.  I ended up needing to hack on the script repeatedly
while testing to disable the sleep.

It would be much nicer if the script would detect that it was being
run by a user and not being run by cron.  This is typically done by
looking at the tty.  Please change to use a conditional around the
sleep to avoid it when not being run by cron.

  if [ ! -t 0 ]; then # sleep only if not interactive
    RANGE=3600
    number=`od -vAn -N2 -tu4 < /dev/urandom`
    number=`expr $number "%" $RANGE`
    sleep $number
  fi

Thanks,
Bob


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to