Bug 447647 - freshclam-sleep is needlessly complex
Summary: freshclam-sleep is needlessly complex
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: clamav
Version: 9
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Enrico Scholz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-05-20 22:33 UTC by Gordon Messmer
Modified: 2008-05-21 07:13 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-05-21 07:13:22 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Gordon Messmer 2008-05-20 22:33:24 UTC
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 07:13:22 UTC
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.