Bug 1278587

Summary: [regression] updatedb no longer runs daily, and mlocate-updatedb.service blocks systemctl
Product: [Fedora] Fedora Reporter: Hin-Tak Leung <htl10>
Component: mlocateAssignee: Michal Sekletar <msekleta>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 23CC: alexey.brodkin, andrea.vai, gbcox, j.stippa, mark, mitr, msekleta, mvanross, stephen.gowing, tom
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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 19:52:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Hin-Tak Leung 2015-11-05 21:41:24 UTC
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 09:04:40 UTC
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 05:11:37 UTC
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 19:02:38 UTC
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 14:14:22 UTC
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 14:15:26 UTC
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-19 01:23:20 UTC
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-20 03:58:39 UTC
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 19:52:35 UTC
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 17:58:53 UTC
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 05:28:30 UTC
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 08:44:39 UTC
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 10:15:13 UTC
As said, needs to be re-opened.

Comment 13 Hin-Tak Leung 2016-11-28 16:37:06 UTC
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