1 |
commit: 681ce7bbb832154ab194bc579d095b4c39c807b9 |
2 |
Author: Florian Schmaus <flo <AT> geekplace <DOT> eu> |
3 |
AuthorDate: Tue May 11 14:24:38 2021 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jun 1 09:40:37 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=681ce7bb |
7 |
|
8 |
sys-apps/plocate: homogenize cron and systemd timer name |
9 |
|
10 |
On systems using systemd with a cron compatibility layer, |
11 |
e.g. sys-process/systemd-cron, udpatedb would potentially run twice |
12 |
daily: One time invoked by cron, and a another time invoked by the |
13 |
systemd timer. |
14 |
|
15 |
This can be avoided if the cron file and the systemd timer have the |
16 |
exact same name. If a systemd native timer with the same name is |
17 |
found, systemd-crontab-generator (of sys-process/systemd-cron) will |
18 |
ignore the cron file [1]. |
19 |
|
20 |
Therefore we rename the plocate cron file from plocate to |
21 |
plocate-udpatedb, to match the systemd plocate-updatedb.timer. |
22 |
|
23 |
1: |
24 |
https://github.com/systemd-cron/systemd-cron/blob/be4aea647bce9a0f26c9b8126f7883dd5c0b60a2/src/bin/systemd-crontab-generator.py#L535 |
25 |
|
26 |
Closes: https://bugs.gentoo.org/780351 |
27 |
Signed-off-by: Florian Schmaus <flo <AT> geekplace.eu> |
28 |
Closes: https://github.com/gentoo/gentoo/pull/20771 |
29 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
30 |
|
31 |
sys-apps/plocate/{plocate-1.1.7.ebuild => plocate-1.1.7-r1.ebuild} | 7 +++++-- |
32 |
1 file changed, 5 insertions(+), 2 deletions(-) |
33 |
|
34 |
diff --git a/sys-apps/plocate/plocate-1.1.7.ebuild b/sys-apps/plocate/plocate-1.1.7-r1.ebuild |
35 |
similarity index 86% |
36 |
rename from sys-apps/plocate/plocate-1.1.7.ebuild |
37 |
rename to sys-apps/plocate/plocate-1.1.7-r1.ebuild |
38 |
index 4aaa46baf9c..a708c02300a 100644 |
39 |
--- a/sys-apps/plocate/plocate-1.1.7.ebuild |
40 |
+++ b/sys-apps/plocate/plocate-1.1.7-r1.ebuild |
41 |
@@ -62,8 +62,11 @@ src_install() { |
42 |
fperms 0644 /etc/{updatedb,plocate-cron}.conf |
43 |
|
44 |
insinto /etc/cron.daily |
45 |
- newins "${FILESDIR}"/plocate.cron plocate |
46 |
- fperms 0755 /etc/cron.daily/plocate |
47 |
+ # Ensure that the cron file has the same name as the |
48 |
+ # systemd-timer, to avoid plocate being run twice daily on systems |
49 |
+ # with a systemd compatiblity layer. See also bug #780351. |
50 |
+ newins "${FILESDIR}"/plocate.cron plocate-updatedb |
51 |
+ fperms 0755 /etc/cron.daily/plocate-updatedb |
52 |
|
53 |
systemd_dounit "${BUILD_DIR}"/${PN}-updatedb.service "${S}"/${PN}-updatedb.timer |
54 |
} |