Bug 447647 - freshclam-sleep is needlessly complex
freshclam-sleep is needlessly complex
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: clamav (Show other bugs)
9
All Linux
low Severity low
: ---
: ---
Assigned To: Enrico Scholz
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-20 18:33 EDT by Gordon Messmer
Modified: 2008-05-21 03:13 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-05-21 03:13:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Gordon Messmer 2008-05-20 18:33:24 EDT
Description of problem:
This line appears in freshclam-sleep, a Fedora script:
	sleep $[ (FRESHCLAM_DELAY % FRESHCLAM_MOD + FRESHCLAM_MOD) % FRESHCLAM_MOD ]

This line is equivalent, and is easier to read:

	sleep $[ FRESHCLAM_DELAY % FRESHCLAM_MOD ]

Additionally, since cron executes jobs in parallel, there's no reason to have
FRESHCLAM_MOD in any of the files.  It could be removed from sysconfig/freshclam
and freshclam-sleep entirely with no detrimental effects.  Users might notice
that there are multiple freshclam-sleep jobs sleeping at any given time, but
that won't cause any problems, and simplifies configuration.  As it is, users
may still see that if they adjust the cron schedule and not FRESHCLAM_MOD.
Comment 1 Enrico Scholz 2008-05-21 03:13:22 EDT
Won't change it.  Mentioned line is due to

| $ d=-5
| $ m=10
| $ echo $[ d % m ]
| -5
| $ echo $[ (d % m + m) % m ]
| 5

FRESHCLAM_MOD must stay as FRESHCLAM_DELAY is calculated from 'hostid' which
returns a 32 bit number.

Note You need to log in before you can comment on or make changes to this bug.