Package: btrfsmaintenance
Version: 0.5-1
Severity: normal
Tags: patch upstream

Dear Maintainer,

when changing BTRFS_BALANCE_PERIOD, BTRFS_SCRUB_PERIOD etc. via systemd timer
the existing OnCalender entry needs to be emptied first as systemd timers are 
cumulative.

i had updated /etc/default/btrfsmaintenance to include:
BTRFS_SCRUB_PERIOD="quarterly"

and ran `sudo systemctl restart btrfsmaintenance-refresh.service` 
but noticed that this change was not reflected in the systemctl output:
NEXT                        LEFT                LAST                        
PASSED     UNIT                ACTIVATES
Wed 2023-02-01 00:00:00 PST 4 weeks 0 days left Sun 2023-01-01 00:00:00 PST 2 
days ago btrfs-scrub.timer   btrfs-scrub.service

1 timers listed.
Pass --all to see loaded but inactive timers, too.

when i updated the generated 
/etc/systemd/system/btrfs-scrub.timer.d/schedule.conf
file to empty the existing OnCalendar value:
[Timer]
OnCalendar=
OnCalendar=quarterly

and reran `sudo systemctl restart btrfsmaintenance-refresh.service`
it was successfully updated:
NEXT                        LEFT                  LAST                        
PASSED     UNIT              ACTIVATES
Sat 2023-04-01 00:00:00 PDT 2 months 26 days left Sun 2023-01-01 00:00:00 PST 2 
days ago btrfs-scrub.timer btrfs-scrub.service

1 timers listed.
Pass --all to see loaded but inactive timers, too.

i have included a brief patch to address this.

thanks in advance.

        andy

-- System Information:
Debian Release: 11.6
  APT prefers stable-updates
  APT policy: (990, 'stable-updates'), (990, 'stable-security'), (990, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-20-amd64 (SMP w/6 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages btrfsmaintenance depends on:
ii  btrfs-progs  5.10.1-2
ii  cron         3.0pl1-137
ii  systemd      247.3-7+deb11u1

btrfsmaintenance recommends no packages.

btrfsmaintenance suggests no packages.

-- Configuration Files:
/etc/default/btrfsmaintenance changed:
BTRFS_LOG_OUTPUT="stdout"
BTRFS_DEFRAG_PATHS=""
BTRFS_DEFRAG_PERIOD="none"
BTRFS_DEFRAG_MIN_SIZE="+1M"
BTRFS_BALANCE_MOUNTPOINTS="auto"
BTRFS_BALANCE_PERIOD="monthly"
BTRFS_BALANCE_DUSAGE="5 10"
BTRFS_BALANCE_MUSAGE="5"
BTRFS_SCRUB_MOUNTPOINTS="auto"
BTRFS_SCRUB_PERIOD="quarterly"
BTRFS_SCRUB_PRIORITY="idle"
BTRFS_SCRUB_READ_ONLY="false"
BTRFS_TRIM_PERIOD="none"
BTRFS_TRIM_MOUNTPOINTS="/"
BTRFS_ALLOW_CONCURRENCY="false"


-- no debconf information
--- 
/var/tmp/user/1000/andrew@gondolin:_usr_share_btrfsmaintenance_btrfsmaintenance-refresh-cron.sh.2023-01-03T14:32:38-0800.3233449
    2020-10-02 18:47:48.000000000 -0700
+++ /usr/share/btrfsmaintenance/btrfsmaintenance-refresh-cron.sh        
2023-01-03 14:32:49.533881598 -0800
@@ -74,6 +74,7 @@
                        mkdir -p /etc/systemd/system/"$SERVICE".timer.d/
                        cat << EOF > 
/etc/systemd/system/"$SERVICE".timer.d/schedule.conf
 [Timer]
+OnCalendar=
 OnCalendar=$PERIOD
 EOF
                        systemctl enable "$SERVICE".timer &> /dev/null

Reply via email to