#758782 tiger: TigerCron should randomize start time

Package:
tiger
Source:
tiger
Description:
security auditing and intrusion detection tools for Linux
Submitter:
Ludovic Pouzenc
Date:
2014-08-21 10:09:06 UTC
Severity:
wishlist
#758782#5
Date:
2014-08-21 10:01:12 UTC
From:
To:
Dear Maintainer,

In virtualized environnements, tiger could cause I/O storms. An example of bad
situation :

tiger with default conf on 15 VM in a same KVM host.
The first August at 2:00 AM , all VM + the host starts find_files check.
IO load gets very high at 02:01 and other services are impacted.

I think we could imitate apt cron behavior to randomize start time, adjusting
the minute part only. Basicaly they use a sleep $(random 1800).

I this could be done only by altering the tigercron script and adding a
function like the apt one :
# sleep for a random interval of time (default 30min)
# (some code taken from cron-apt, thanks)
random_sleep()
{
    RandomSleep=1800
    eval $(apt-config shell RandomSleep APT::Periodic::RandomSleep)
    if [ $RandomSleep -eq 0 ]; then
        return
    fi
    if [ -z "$RANDOM" ] ; then
        # A fix for shells that do not have this bash feature.
        RANDOM=$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -c"1-5")
    fi
    TIME=$(($RANDOM % $RandomSleep))
    debug_echo "sleeping for $TIME seconds"
    sleep $TIME
}

Maybe this introduce some dependancies like "coreutils" (but seems a common
case).

Regards,
Ludovic