Package: snapper
Version: 0.10.6-1.2+b2
Severity: normal

Dear Maintainer,

* What led up to the situation?

  I was checking my root snapshots and noticed that for a single run of
  "apt update" invoked automatically by unattended-upgrades, I had more
  than fifty snapshots with timestamps seconds apart. This has two
  problems:

    1. Since the default retention number is 50, I had no snapshots from
       before apt ran.
    2. I don't really care about snapshots from before and after
       installation of each individual package. What I care about is
       snapshots from before and after running "apt upgrade".

* What exactly did you do that was effective?

I changed the apt hook script to hook APT::Install::Pre-Invoke and
APT:Install::Post-Invoke-Success instead of Dpkg::Pre-Invoke and
Dpkg::Post-Invoke. See attached.

* What was the outcome of this action?

Now when I run "apt upgrade" or "apt install" I get a single pre/post
snapshot pair no matter how many packages I install. As a sysadmin this
is much more useful.

Please update the script to use the APT::Install hooks instead.

Note that there doesn't appear to be any APT::Install::Post-Invoke hook
analagous to Dpkg::Post-Invoke. There is only
APT::Install::Post-Invoke-Success. However I don't think this matters
much since if apt failed then taking a snapshot of the broken state
isn't very useful.

Cheers,
Scott.


-- System Information:
Debian Release: forky/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.19.6+deb14+1-amd64 (SMP w/24 CPU threads; PREEMPT)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_AU:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages snapper depends on:
ii  libboost-thread1.83.0  1.83.0-5+b2
ii  libc6                  2.42-13
ii  libdbus-1-3            1.16.2-4
ii  libgcc-s1              16-20260308-1
ii  libjson-c5             0.18+ds-3
ii  libmount1              2.41.3-4
ii  libsnapper7t64         0.10.6-1.2+b2
ii  libstdc++6             16-20260308-1
ii  libtinfo6              6.6+20251231-1

snapper recommends no packages.

snapper suggests no packages.

-- Configuration Files:
/etc/apt/apt.conf.d/80snapper changed:
  APT::Install::Pre-Invoke  { "if [ -e /etc/default/snapper ]; then . 
/etc/default/snapper; fi; if [ -x /usr/bin/snapper ] && [ ! 
x$DISABLE_APT_SNAPSHOT = 'xyes' ] && [ -e /etc/snapper/configs/root ]; then rm 
-f /var/tmp/snapper-apt || true ; snapper create -d apt -c number -t pre -p > 
/var/tmp/snapper-apt || true ; snapper cleanup number || true ; fi"; };
  APT::Install::Post-Invoke-Success { "if [ -e /etc/default/snapper ]; then . 
/etc/default/snapper; fi; if [ -x /usr/bin/snapper ] && [ ! 
x$DISABLE_APT_SNAPSHOT = 'xyes' ] && [ -e /var/tmp/snapper-apt ]; then snapper 
create -d apt -c number -t post --pre-number=`cat /var/tmp/snapper-apt` || true 
; snapper cleanup number || true ; fi"; };

/etc/default/snapper changed:
SNAPPER_CONFIGS="root home"
DISABLE_APT_SNAPSHOT="no"


-- no debconf information

Reply via email to