Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 780351 - sys-apps/plocate: Do not cron job if systemd timer is enabled
Summary: sys-apps/plocate: Do not cron job if systemd timer is enabled
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Arsen Arsenović
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2021-04-05 10:05 UTC by Florian Schmaus
Modified: 2021-06-01 09:40 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Schmaus gentoo-dev 2021-04-05 10:05:06 UTC
On systems using systemd with a cron compatibility layer, e.g. sys-process/systemd-cron, udpatedb would potentially run twice daily: One time invoked by cron, and a another time invoked by the systemd timer.

To avoid this, the cron script could check if the plocate-updatedb systemd timer is enabled, and abort if so.

Reproducible: Always
Comment 1 Larry the Git Cow gentoo-dev 2021-06-01 09:40:48 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=681ce7bbb832154ab194bc579d095b4c39c807b9

commit 681ce7bbb832154ab194bc579d095b4c39c807b9
Author:     Florian Schmaus <flo@geekplace.eu>
AuthorDate: 2021-05-11 14:24:38 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-06-01 09:40:37 +0000

    sys-apps/plocate: homogenize cron and systemd timer name
    
    On systems using systemd with a cron compatibility layer,
    e.g. sys-process/systemd-cron, udpatedb would potentially run twice
    daily: One time invoked by cron, and a another time invoked by the
    systemd timer.
    
    This can be avoided if the cron file and the systemd timer have the
    exact same name. If a systemd native timer with the same name is
    found, systemd-crontab-generator (of sys-process/systemd-cron) will
    ignore the cron file [1].
    
    Therefore we rename the plocate cron file from plocate to
    plocate-udpatedb, to match the systemd plocate-updatedb.timer.
    
    1:
    https://github.com/systemd-cron/systemd-cron/blob/be4aea647bce9a0f26c9b8126f7883dd5c0b60a2/src/bin/systemd-crontab-generator.py#L535
    
    Closes: https://bugs.gentoo.org/780351
    Signed-off-by: Florian Schmaus <flo@geekplace.eu>
    Closes: https://github.com/gentoo/gentoo/pull/20771
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/plocate/{plocate-1.1.7.ebuild => plocate-1.1.7-r1.ebuild} | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)