On Monday, 22 January 2018 15:16:44 GMT Andrei Borzenkov wrote:
On Mon, Jan 22, 2018 at 6:07 PM, CnZhx
wrote: On Monday, 22 January 2018 11:43:32 GMT Frederic Crozat wrote:
Le lundi 22 janvier 2018 à 10:58 +0000, CnZhx a écrit :
Thanks for the heads-up. Do you happen to know is it possible to add an option of `OnBootSec=1h` in [Timer] section of .timer file to make the process start after 1 hour after boot?
Try creating (untested)
/etc/systemd/system/btrfs-balance.timer.d/later.conf
containing:
[Timer] OnBootSec=1h
and run systemctl daemon-reload
Note that timers are triggered when either specification expires. Which means it will run 1 hour after boot *or* as otherwise specified.
This was discussed recently, the only way to do it is to have second timer that triggers 1 hour after boot and starts service that starts fstrim.timer while leaving fstrim.timer itself disabled.
Before this comment, I set 10 minutes for the `/etc/systemd/system/btrfs- balance.timer.d/later.conf`, and reload by running `systemctl daemon-reload`. Then I reboot the machine. Observation gives has follows.
I have created this file and reloaded the confs by running `sudo systemctl daemon-reload`. Do you know a way to trigger it to load on next reboot? I do not want to wait for 6 days to check it because when I check the timers, it says, ``` $ systemctl list-timers NEXT LEFT LAST PASSED UNIT ACTIVATES Mon 2018-01-22 16:00:00 GMT 56min left Mon 2018-01-22 15:00:01 GMT 3min 35s ago snapper-timeline.timer snapper-t Tue 2018-01-23 00:00:00 GMT 8h left Mon 2018-01-22 08:59:46 GMT 6h ago logrotate.timer logrotate Tue 2018-01-23 09:04:52 GMT 18h left Mon 2018-01-22 09:04:52 GMT 5h 58min ago snapper-cleanup.timer snapper-c Tue 2018-01-23 09:09:52 GMT 18h left Mon 2018-01-22 09:09:52 GMT 5h 53min ago systemd-tmpfiles-clean.timer systemd-t Mon 2018-01-29 00:00:00 GMT 6 days left Mon 2018-01-22 08:59:46 GMT 6h ago btrfs-balance.timer btrfs-bal Mon 2018-01-29 00:00:00 GMT 6 days left Mon 2018-01-22 08:59:46 GMT 6h ago fstrim.timer fstrim.se Thu 2018-02-01 00:00:00 GMT 1 weeks 2 days left Sun 2018-01-07 19:40:45 GMT 2 weeks 0 days ago btrfs-scrub.timer btrfs-scr
7 timers listed. Pass --all to see loaded but inactive timers, too. lines 1-11/11 (END) ``` Now, the list-timers looks like this,
systemctl list-timers
NEXT LEFT LAST
PASSED UNIT ACTIVATES
Mon 2018-01-22 16:14:52 GMT 3min 46s left Mon 2018-01-22 08:59:46 GMT
7h ago btrfs-balance.timer btrfs-balance.service
Mon 2018-01-22 16:14:52 GMT 3min 46s left n/a
n/a snapper-cleanup.timer snapper-cleanup.service
Mon 2018-01-22 16:19:52 GMT 8min left n/a
n/a systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
Mon 2018-01-22 17:00:00 GMT 48min left n/a
n/a snapper-timeline.timer snapper-timeline.service
Tue 2018-01-23 00:00:00 GMT 7h left Mon 2018-01-22 08:59:46 GMT
7h ago logrotate.timer logrotate.service
Mon 2018-01-29 00:00:00 GMT 6 days left Mon 2018-01-22 08:59:46 GMT
7h ago fstrim.timer fstrim.service
Thu 2018-02-01 00:00:00 GMT 1 weeks 2 days left Sun 2018-01-07 19:40:45 GMT
2 weeks 0 days ago btrfs-scrub.timer btrfs-scrub.service
7 timers listed.
Pass --all to see loaded but inactive timers, too.
It seems that snapper-cleanup.timer, systemd-tmpfiles-clean.timer and snapper- timeline.timer are different. And after several minutes, `sudo journalctl -f -u btrfs-balance.service` gives me this, ```-- Logs begin at Mon 2018-01-22 14:53:27 GMT. -- Jan 22 16:15:01 ostp.cnzhx.net btrfs-balance.sh[9598]: Done, had to relocate 0 out of 19 chunks ... (truncated similar messages)... ``` Then, `$ systemctl list-timers` shows this, ``` NEXT LEFT LAST PASSED UNIT ACTIVATES Mon 2018-01-22 17:00:00 GMT 40min left n/a n/a snapper-timeline.timer snapper-timeline.service Tue 2018-01-23 00:00:00 GMT 7h left Mon 2018-01-22 08:59:46 GMT 7h ago logrotate.timer logrotate.service Tue 2018-01-23 16:15:01 GMT 23h left Mon 2018-01-22 16:15:01 GMT 4min 52s ago snapper-cleanup.timer snapper-cleanup.service Mon 2018-01-29 00:00:00 GMT 6 days left Mon 2018-01-22 16:15:01 GMT 4min 52s ago btrfs-balance.timer btrfs-balance.service Mon 2018-01-29 00:00:00 GMT 6 days left Mon 2018-01-22 08:59:46 GMT 7h ago fstrim.timer fstrim.service Thu 2018-02-01 00:00:00 GMT 1 weeks 2 days left Sun 2018-01-07 19:40:45 GMT 2 weeks 0 days ago btrfs-scrub.timer btrfs-scrub.service n/a n/a Mon 2018-01-22 16:19:53 GMT 30ms ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service 7 timers listed. Pass --all to see loaded but inactive timers, too. ``` So, `btrfs-balance` does run at 10min after boot. But I do not know what does other information indicate. This is beyond my knowledge. I guess, if the `btrfs-balance` does run regularly, maybe it will not take too much long time every time. As long as users know this could happen, it won't cause problem except for delaying the login screen sometimes. Then, a message saying that BtrFS maintenance is running is enough. Does this deserve a bug report? Regards, Haoxian -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org