Currently, both sys-apps/mlocate and sys-apps/man-db ship with a cron script that goes to cron.daily, and only works as intended on systems with a cron daemon. But, as systemd already incorporates support for cron-like functionality with timers, I would suggest adding a timer unit and a service files for these two packages respectively, by shipping and activating them (either statically by making a symlink to a defined target through a post-install step or by invoking systemctl enable) with a timers flag or any other USE flag that could provide similar functionality. This way, systems with systemd and without cron would still be able to keep there mlocate and man databases up to date. Arch Linux already does this, and for now, I've imported their scripts and added an [Install] section to their timers to enable it, rather than making a symlink. I'm thus adding links for those two packages from the Arch git repositories, and leaving everything else up to the developers to discuss and decide. Reproducible: Always Steps to Reproduce: N/A Actual Results: N/A Expected Results: N/A https://git.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/man-db https://git.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/mlocate
> by shipping and activating them I'm not sure about activating things by default. I don't even think it makes sense to enable the cron jobs by default, but that's a historical remnant. I'm thinking we could put a pkg_postinst message behind 'systemd_is_booted' if we are really concerned about making the user aware of them. For example: pkg_postinst() { if systemd_is_booted; then elog "systemd timer unit X.timer has been installed." elog "Activate it with 'systemd enable X.timer'" fi }
That is fine too.
*** Bug 642150 has been marked as a duplicate of this bug. ***
*** Bug 642152 has been marked as a duplicate of this bug. ***
man-db-2.8.5 installs a systemd timer unit.
More inspiration for the timer/service files is provided by the Fedora package: https://src.fedoraproject.org/rpms/mlocate/tree/master
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0af088b41c694fbfd94e1db51a9df836eda0f7fd commit 0af088b41c694fbfd94e1db51a9df836eda0f7fd Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2020-04-12 16:06:19 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2020-04-12 16:17:13 +0000 sys-apps/mlocate: modernize ebuild - EAPI=7 - Depend on acct-group/locate - Install systemd service/timer - Remove unneeded fperms/chown - Display postinst message on initial install only Closes: https://bugs.gentoo.org/622236 Closes: https://bugs.gentoo.org/509994 Package-Manager: Portage-2.3.96_p4, Repoman-2.3.22_p1 Signed-off-by: Mike Gilbert <floppym@gentoo.org> sys-apps/mlocate/files/updatedb.service | 7 ++++ sys-apps/mlocate/files/updatedb.timer | 10 ++++++ sys-apps/mlocate/mlocate-0.26-r3.ebuild | 63 +++++++++++++++++++++++++++++++++ 3 files changed, 80 insertions(+)