You are not logged in.
Packages that have auto-enabled systemd timers do it by having a symlink in /usr/lib/systemd/system/<target>.target.wants.
This aproach is confusing. For example:
# systemctl status logrotate.timer
? logrotate.timer - Daily rotation of log files
Loaded: loaded (/usr/lib/systemd/system/logrotate.timer; static)
Active: active (waiting) since Qua 2014-05-28 07:21:34 BRT; 34min ago
logrotate.timer *is* enabled and if I run systemctl disable it does nothing:
# systemctl disable logrotate.timer
# ls -l /usr/lib/systemd/system/multi-user.target.wants/logrotate.timer
lrwxrwxrwx 1 root root 18 Abr 13 04:13 /usr/lib/systemd/system/multi-user.target.wants/logrotate.timer -> ../logrotate.timer
Probably the behaviour is right. systemd considers /usr package manager territory.
Even with an [Install] section, /usr symlink will override /etc for systemctl disable.
So the only way to disable these units is manually create a null symlink in /etc or (with [Install]) through systemctl mask.
As a former Fedora user, RPM generally auto-enable things in its post install scriptlets via systemctl, working allways in /etc.
BTW, as an experiment, I put a [Install]\nWantedBy=multi-user.target in /usr/lib/systemd/system/logrotate.timer and after systemctl daemon-reload systemd says the unit is disabled:
# systemctl status logrotate.timer
? logrotate.timer - Daily rotation of log files
Loaded: loaded (/usr/lib/systemd/system/logrotate.timer; disabled)
Active: active (elapsed) since Qua 2014-05-28 07:21:34 BRT; 1h 9min ago
Is this a bug?
Offline
I have the same problem with the updatedb.timer. I want to run updatedb manually only, how can I achieve that cleanly with systemd?
Autojump, the fastest way to navigate your filesystem from the command line!
Offline
I have the same question, because I want to disable man-db. I was told that I need to "mask" it, but I don't know whether to mask the service, the timer, or both.
Tim
Offline
Offline
Have you tried masking them?
Offline
Upstream discussion about this:
Offline
If you want to change the timer to monthly or yearly etc, first disable and stop the timer units that you want to change. Then, copy for example, the man-db.timer units file to /etc/systemd/system and change the [Timer] sections. Enable and start the new man-db.timer settings.
$ systemctl cat man-db.timer
# /etc/systemd/system/man-db.timer
[Unit]
Description=Monthly man-db cache update
[Timer]
OnCalendar=monthly
AccuracySec=12h
Persistent=true
$ systemctl list-timers man-db.timer
NEXT LEFT LAST PASSED UNIT ACTIVATES
Mon 2014-12-01 00:00:00 MYT 6 days left Mon 2014-11-24 00:00:01 MYT 22h ago man-db.timer man-db.service
1 timers listed.
Pass --all to see loaded but inactive timers, too.
Last edited by serdotlinecho (2014-11-24 14:17:25)
Offline
Have you tried masking them?
It is the only way. Manually:
systemctl stop xxx.timer
cd /etc/systemd/system
ln -s /dev/null xxx.timer
systemctl daemon-reload
Offline
Why manually?
Offline
Because they do not have an [Install] section. systemctl disable/mask will do nothing. Even with [Install] systemctl disable will not change anything because /usr symlink takes precedence.
Offline
Because they do not have an [Install] section. systemctl disable/mask will do nothing. Even with [Install] systemctl disable will not change anything because /usr symlink takes precedence.
???
# systemctl mask man-db.timer
Created symlink from /etc/systemd/system/man-db.timer to /dev/null.
How is that different from your manual symlink? Obviously disable is not going to do anything for a service that wasn't hooked up using enable, but masking works.
Offline
Hmm. I remember trying systemctl mask on older versions without sucess. But it seems fixed now. Thanks for the heads-up!
Offline
I don't understand either.
Marcos FRM, what do you get when trying to run 'systemctl mask man-db.timer'?
$ sudo systemctl mask man-db.timer
Created symlink from /etc/systemd/system/man-db.timer to /dev/null.
~ $ sudo systemctl unmask man-db.timer
Removed symlink /etc/systemd/system/man-db.timer.
Edit: Too late.
Last edited by karol (2014-11-25 11:21:30)
Offline