cron daily runs updatedb twice

Bug #197170 reported by Jürgen Kreileder
8
Affects Status Importance Assigned to Milestone
mlocate (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: mlocate

ii findutils 4.2.32-1ubuntu utilities for finding files--find, xargs
ii mlocate 0.18-2 quickly find files on the filesystem based o

Looks like cron.daily runs updatedb twice when mlocate and findutils are installed. (findutils pulled in through ubuntu-minimal)
Once from /etc/cron.daily/mlocate and once from /etc/cron.daily/find.

Revision history for this message
James Westby (james-w) wrote :

It's actually a bit worse than that. On my system
/etc/cron.daily/find calls updatedb without ensuring
that it exists, either by shipping the program, or
depending on a package that does.

I see that the source package contains a different
cronjob. Perhaps there is a problem installing that.

Jeurgen, I suspect that this isn't a fresh hardy alpha
5 install, is that correct?

Thanks,

James

Changed in mlocate:
status: New → Confirmed
Revision history for this message
Jürgen Kreileder (jk) wrote :

Yea, it's feisty->gutsy->hardy system.

$ dpkg -S /etc/cron.daily/find
findutils: /etc/cron.daily/find
$ dpkg -s findutils
[...]
Conffiles:
 /etc/cron.daily/find 7eb265877a0e861849027c1f6ec8e8ec obsolete
 /etc/updatedb.conf 086d4e247cefd32f5fbef1c1a4185aca obsolete
[...]

Maybe findutils should be a bit more proactive about deleting the obsolete cron job when upgrading. At least it's NEWS file should mention that the cron job is obsolete and might have to be removed manually.

Revision history for this message
Jörg Höhle (joerg-cyril-hoehle) wrote : Re: cron daily runs updatedb 3x

On my system (Gutsy (release) -> Hardy (release)),
updatedb is run thrice, because I have the following in /etc/cron.daily:
  -rwxr-xr-x 1 root root 473 2007-10-03 20:36 find
  -rwxr-xr-x 1 root root 473 2007-12-12 14:19 find.notslocate.dpkg-new
  -rwxr-xr-x 1 root root 183 2008-03-08 19:22 mlocate
find and find.notslocate are identical except for
find: calls ionice -p (bogus)
find.notslocate...: calls ionice -n (correct)

# dpkg -s findutils
Conffiles:
 /etc/cron.daily/find 56d5ad07a14419d1fae3d2620f2d9ff9 obsolete
updatedb.conf is not mentioned at all (the file is present).

Revision history for this message
robepisc (robepisc) wrote :

On mine updatedb runs 4 (FOUR) times a day!!!
The history of my system's upgrades is: Warty->Hoary->Breezy->Dapper->Hardy.
When I did the last upgrade, I had, and still have, dlocate installed (which depends on findutils' locate).

/etc/cron.daily/:
  -rwxr-xr-x 1 root root 419 2004-08-13 02:01 find
  -rwxr-xr-x 1 root root 419 2006-03-20 07:25 find.notslocate.dpkg-new
  -rwxr-xr-x 1 root root 2205 2008-04-02 16:22 locate
  -rwxr-xr-x 1 root root 183 2008-03-08 19:22 mlocate

A diff on "find" and "find.notslocate.dpkg-new" says they are absolutely identical.
And they both are useless, being obsolete.
I don't need locale's updatedb cron-job, but need locale's frcode tool (required by dlocate, see LP#225419); so I can't uninstall locale and, as a bonus, get its updatedb.
Of the 4 updatedb my system runs every day, the only needed is the one from mlocate.

Oh madness...

Revision history for this message
robepisc (robepisc) wrote :

Of course s/locale/locate/g in my last post. Sorry.

Revision history for this message
Graeme Hewson (ghewson) wrote :

After upgrading straight from Dapper to Hardy (ie, from the first LTS release to the second), I got this message:

run-parts: /etc/cron.daily/find exited with return code 127

which is due to this:

cd / && nice -n ${NICE:-10} updatedb 2>/dev/null

updatedb no longer exists on my system, and as James said above, the script doesn't check for its existence. The upgrade should have removed /etc/cron.daily/find, and that's what I've done manually. The same function is provided by /etc/cron.daily/slocate.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

Thanks for your report.
This is fixed in 4.4.0-2ubuntu1 in Intrepid and 4.2.32-1ubuntu2 in Hardy.

findutils (4.2.32-1ubuntu2) hardy; urgency=low

  * debian/findutils.preinst:
    - fix check for removal of the oboslete /etc/cron.daily/find
      on gutsy->hardy upgrades (LP: #210699)

 -- Michael Vogt <email address hidden> Wed, 02 Apr 2008 16:15:17 +0200

Feel free to re-open if this is still an issue. Thanks for your time.

Changed in mlocate:
status: Confirmed → Fix Released
Revision history for this message
Emmet Caulfield (emmetcaulfield) wrote :

“This is fixed in ... 4.2.32-1ubuntu2 in Hardy.”

I beg to differ. As of today with all updates applied on Hardy:

    $ ls /etc/cron.daily/find
    /etc/cron.daily/find
    $ dpkg -S /etc/cron.daily/find
    findutils: /etc/cron.daily/find
    $ dpkg -s findutils | grep ^Version
    Version: 4.2.32-1ubuntu2

So, the file is still there and the findutils package still appears to own it. It's reasonably clear to the moderately knowledgeable user that the orphaned /etc/cron.daily/find.notslocate.dpkg-new can be deleted without causing headaches further down the line. It is not clear with /etc/cron.daily/find. A real fix must, I think, check for and remove all of the historically obsolete files so that the farcical situation of updatedb running “one plus the number of distribution upgrades” times is alleviated for the ordinary user.

Revision history for this message
Greg (iskimj) wrote :

This bug still exists in Maverick, findutils version 4.4.2-1

   $ ls /etc/cron.daily/find
   /etc/cron.daily/find
   $ dpkg -S /etc/cron.daily/find
   findutils: /etc/cron.daily/find
   $ dpkg -s findutils | grep ^Version
   Version: 4.4.2-1ubuntu1

This system has been upgraded over the years... I don't remember the first version, Feisty, maybe?

I have both:
/etc/cron.daily/find
/etc/cron.daily/find.notslocate.dpkg-new

/etc/cron.daily/find.notslocate.dpkg-new won't actually run because of the . in the filename. That file is effectively hidden. This is true for all cron scripts, maybe because of run-parts, I forget. So it's not true that updatedb runs “one plus the number of distribution upgrades” times. Definitely runs twice though because of the mlocate script.

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.