spooldir mtime=0 prevents database from being updated

Bug #1773229 reported by Neil Roza
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cron (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

When the spooldir mtime=0, cron refuses to update its "database". This happens because the "old database" mtime is initialized to 0.

```
61: /* if spooldir's mtime has not changed, we don't need to fiddle with
62- * the database.
63- *
64- * Note that old_db->mtime is initialized to 0 in main(), and
65- * so is guaranteed to be different than the stat() mtime the first
66- * time this function is called.
67- */
68- if (old_db->mtime == TMAX(statbuf.st_mtime, syscron_stat.st_mtime)) {
69- Debug(DLOAD, ("[%ld] spool dir mtime unch, no load needed.\n",
70- (long)getpid()))
71- return;
72- }
```

from `database.c`, v4.1

Tags: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in cron (Ubuntu):
status: New → Confirmed
Revision history for this message
Steve Dodd (anarchetic) wrote :

Just been bitten by this - depending on the checkout type, ostree sets the mtime of directories and possibly files to 0 (the epoch.)

Revision history for this message
Steve Dodd (anarchetic) wrote :

Proposed fix, minimally tested, attached.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "mtime-fix.diff" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.