Bug 1278587 - [regression] updatedb no longer runs daily, and mlocate-updatedb.service blocks systemctl
[regression] updatedb no longer runs daily, and mlocate-updatedb.service bloc...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: mlocate (Show other bugs)
23
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Michal Sekletar
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-11-05 16:41 EST by Hin-Tak Leung
Modified: 2016-11-28 11:37 EST (History)
10 users (show)

See Also:
Fixed In Version: mlocate-0.26-13.fc23 mlocate-0.26-14.fc24
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-03-22 15:52:42 EDT
Type: Bug
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 Hin-Tak Leung 2015-11-05 16:41:24 EST
Description of problem:
updatedb no longer runs daily, and mlocate-updatedb.service blocks systemctl

updated to f23 about a week before it was officially released, so I have had f23 for over 10 days.

I just found that locate no longer find recent files, and on looking, /etc/cron.daily/mlocate no longer exists (although ironically, it is still found by locate!). So I did rpm -ql mlocate, and see that it seems to have migrated to systemd service:

/usr/lib/systemd/system/mlocate-updatedb.service
/usr/lib/systemd/system/mlocate-updatedb.timer

I am not sure how the timer works, so I try the service, with:

# systemctl enable mlocate-updatedb.service

and it says:
<quote>
The unit files have no [Install] section. They are not meant to be enabled
using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
   .wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
   a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
   D-Bus, udev, scripted systemctl call, ...).
</quote>

so I did 
systemctl start mlocate-updatedb.service

and it immediately starts (which is expected), but it blocks systemctl from returning (which isn't expected) until updatedb finishes, which is a bit terrible.

Version-Release number of selected component (if applicable):
mlocate-0.26-12.fc23.x86_64

How reproducible:
always.

Steps to Reproduce:
1. as describe above.
2.


Actual results:
as described.

Expected results:
Since it used to run daily, it should continue to run daily; and launching updatedb manually should be (1) easier (2) in the background also, in the manner of the old daily script.

Additional info:
Comment 1 Mark Knoop 2015-12-01 04:04:40 EST
I noticed this also. It seems the cron file has been moved to a systemd-timer which was disabled. 

# systemctl status mlocate-updatedb.timer 
● mlocate-updatedb.timer - Updates mlocate database every day
   Loaded: loaded (/usr/lib/systemd/system/mlocate-updatedb.timer; disabled; vendor preset: enabled)
   Active: inactive (dead
# systemctl enable mlocate-updatedb.timer

So the question is why this is not enabled on upgrade?
Comment 2 Gerald Cox 2016-01-28 00:11:37 EST
Noticed updatedb is no longer running daily.  Found mlocate-updatedb.timer and enabled and started it.  Hopefully, that will fix the problem.
Comment 3 Joerg Stippa 2016-03-02 14:02:38 EST
When the system boots and updatedb is required to be executed then it will contain only "/usr" but no subdirectory of it.
# locate -d mlocate.db.boot / | grep ^/usr
/usr
# rpm -q mlocate 
mlocate-0.26-12.fc23.x86_64
Comment 4 Fedora Update System 2016-03-18 10:14:22 EDT
mlocate-0.26-13.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-dd988b6d40
Comment 5 Fedora Update System 2016-03-18 10:15:26 EDT
mlocate-0.26-14.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-85f0a2950b
Comment 6 Fedora Update System 2016-03-18 21:23:20 EDT
mlocate-0.26-13.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-dd988b6d40
Comment 7 Fedora Update System 2016-03-19 23:58:39 EDT
mlocate-0.26-14.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-85f0a2950b
Comment 8 Fedora Update System 2016-03-22 15:52:35 EDT
mlocate-0.26-13.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.
Comment 9 Fedora Update System 2016-03-26 13:58:53 EDT
mlocate-0.26-14.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.
Comment 10 Tom Trebisky 2016-05-01 01:28:30 EDT
It is still necessary to do this, which should not be needed, it should be the default:

systemctl enable mlocate-updatedb.timer
Comment 11 Andrea Vai 2016-07-20 04:44:39 EDT
Same for me in Fedora 23. I had to enable manually the service as described in comment #10 to have it working.
Comment 12 Mark van Rossum 2016-11-07 05:15:13 EST
As said, needs to be re-opened.
Comment 13 Hin-Tak Leung 2016-11-28 11:37:06 EST
At least for me it seems to be working on f25 (mlocate-0.26-15.fc25.x86_64).

# ls -l /var/lib/mlocate/*
-rw-r-----. 1 root slocate 38011857 Nov 28 00:04 /var/lib/mlocate/mlocate.db

Hmm, I have a sym-link, must have been enabled a long time ago:

# ls -l /etc/systemd/system/timers.target.wants/mlocate-updatedb.timer
lrwxrwxrwx. 1 root root 46 Nov 10  2015 /etc/systemd/system/timers.target.wants/mlocate-updatedb.timer -> /usr/lib/systemd/system/mlocate-updatedb.timer

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