Closed comio closed 6 years ago
Alive it is, sorry for late reply. The way the timers are implemented looks ok, there's a switch for the cron/timer, etc. I'm going to merge that, with some additional documentation. Thanks.
Ok. Thank you.
The logic in refresh_timer() is in my opinion wrong: You should not check for "daily|weekly|monthly" and else uninstall, instead you should check if the first argument is "uninstall" and only then uninstall the timers, else use the first argument as new OnCalendar argument. Else you limit the possibilities of systemd timers to three values without any benefit.
interesting PoV.
Something like this?
case "$PERIOD" in
uninstall)
systemctl stop "$SERVICE".timer &> /dev/null
systemctl disable "$SERVICE".timer &> /dev/null
rm -rf /etc/systemd/system/"$SERVICE".timer.d
;;
*)
mkdir -p /etc/systemd/system/"$SERVICE".timer.d/
cat << EOF > /etc/systemd/system/"$SERVICE".timer.d/schedule.conf
[Timer]
OnCalendar=$PERIOD
EOF
systemctl enable "$SERVICE".timer &> /dev/null
systemctl start "$SERVICE".timer &> /dev/null
;;
esac
Two things:
BTRFS_TIMER_IMPLEMENTATION
is not in the config file? btrfsmaintenance-refresh-cron.service is not able to refresh systemd timers. It could if BTRFS_TIMER_IMPLEMENTATION
was in the config file.The first 2 patches merged and pushed to master.
The default itmer periods should be the same as in the sysconfig file.
Aha, that's just a minor issue, the timers are run indirectly from /etc/systemd/system/*.timer.d/schedule.conf
with the proper period. Ok I don't know enough about the timer magic.
https://github.com/kdave/btrfsmaintenance/commit/9ac81bd7b956fb893acaa23c68df322e27b3039b a bit of documentation
Patch "Use BTRFS_{SCRUB,DEFRAG,BALANCE,TRIM}_PERIOD=none in order to disable the associated systemd timer" applied, enhanced changelog based on your oriignal comment.
All patches now applied and will be included in the next release, thanks.
@kdave
Is this repo still alive? Or we need to fork to add these PR?