You are not logged in.
I don't need mandb to run everyday. Especially in my virtual machine. So I do this:
sudo rm -fr /usr/lib/systemd/system/man-db.*
sudo systemctl daemon-reload
sudo systemctl disable man-db.timer
but I still got this:
systemctl list-timers --all
NEXT LEFT LAST PASSED UNIT ACTIVATES
Sun 2014-09-14 00:00:00 HKT 8h left Sat 2014-09-13 13:57:03 HKT 1h 56min ago logrotate.timer logrotate.service
Sun 2014-09-14 00:00:00 HKT 8h left Sat 2014-09-13 13:57:03 HKT 1h 56min ago shadow.timer shadow.service
Sun 2014-09-14 15:21:36 HKT 23h left Sat 2014-09-13 15:21:36 HKT 31min ago systemd-tmpfiles-clean.timer systemd-tmpfiles-cle
n/a n/a Sat 2014-09-13 13:57:03 HKT 1h 56min ago man-db.timer
n/a n/a n/a n/a systemd-readahead-done.timer systemd-readahead-do
5 timers listed.
which means mand-db.timer is still identified by systemd, although it may not work.
Any ideas?
Offline
Alternatively, you could modify man-db.timer so that it runs when you want it.
Offline
It's a static unit, so you can't use "disable". You can remove the timer unit, but that won't survive a man-db update, so masking it would be better. `systemctl mask` creates a symlink (to /dev/null) called man-db.timer under /etc to override the one under /usr/lib. You could instead create your own copy there with a modified trigger (basically what tomk suggests, but you shouldn't modify unit files under /usr/lib).
Offline
Thanks tomk and Raynman. but I don't think "cover it" is the best way. man-db is a index for searching. It should be a event triger, not a time triger. And someone like me rarely use it makes the timer shouldn't exist. Systemd should offer a command to remove it like service. I want to know how systemd store timer information even the file has been removed.
Last edited by gkjarch (2014-09-13 10:13:51)
Offline
If you rarely use it and don't wanna mask the timer, just remove mlocate.
CPU-optimized Linux-ck packages @ Repo-ck • AUR packages • Zsh and other configs
Offline
If you rarely use it and don't wanna mask the timer, just remove mlocate.
mlocate package was not installed!
Offline
I think graysky meant to say remove man-db, not mlocate.
Last edited by tomk (2014-09-13 11:25:46)
Offline
@gkjarch Ad triggering: Mask the man-db.timer and create /etc/systemd/system/man-db.path with this content:
[Unit]
Description=Update man-db cache
[Path]
PathChanged=/var/lib/pacman/local
PathChanged=/usr/share/man/
Unit=mad-db.service
Untested but it should work, I use the same for triggering regeneration of openbox applications menu, only not as static.
Edit: Probably the second path should be lower, since inotify is not recursive (man inotify).
Last edited by emeres (2014-09-13 11:43:00)
Offline
Thanks emeres. I will consider your way. I still think the timer thing is a design defect.
To tomk and graysky, remove man-db package is not an option. Because if you use Linux for several years, you are familiar with the applications you usually use. If something new comes out for example systemd. I will read ArchLinux Wiki first, it may mention man page like "See man systemd.unit for details. ". So command apropos is rarely used, but command man is not.
The reason I want to remove man-db timer is not only because above, but also because it slows down statup. I use double OS Windows and Linux. Access data in Linux partition (include a EXT4 backup hard drive) by using VBox. Command mandb runs 5 minutes at least and CPU is fully loaded in VBox. That really annoy me. Especially everyday.
Last edited by gkjarch (2014-09-14 06:23:52)
Offline
I've found two possible workarounds on this:
Setting the timer to work an specific hour a day as indicated on this Manjaro forum (worked finely);
Setting the timer to work some seconds after booting, as explained on systemd.timer manual (haven't tested but should work as well).
Hope it helps
Offline
Setting the timer to work some seconds after booting, as explained on systemd.timer manual (haven't tested but should work as well).
This is the correct approach. OnBootSec=30min, for example...
Offline