On Sun, 25 Aug 2024 00:16:33 +0200 Ben Hutchings <b...@decadent.org.uk> wrote:
Package: mandos-client
Version: 1.8.16-1
Severity: serious

mandos-client's postrm script can fail on purge with no obvious error
message.  dpkg reports that it exited with error code 128 but it's not
clear why.  I can reproduce this in a bookworm/amd64 or unstable/amd64
build chroot by running:

    apt install -y mandos-client linux-image-amd64
    apt purge -y mandos-client

Ben.



Dear Maintainer,
I just tried to get some more info about this.

By adding a "set -x" at the top of the postrm script I could watch
which commands get executed [2].
At the end it looks like the output of the earlier update-initramfs
gets into stdin of the db_purge call later.

At least when redirecting stdout to stderr [1] of the update-initramfs call
the removal completes without error.

Kind regards,
Bernhard




[1]
--- orig/mandos-client.postrm   2024-04-22 21:13:43.000000000 +0200
+++ redirect/mandos-client.postrm       2024-09-11 09:10:06.222806231 +0200
@@ -34,3 +34,3 @@ update_initramfs()
     if command -v update-initramfs >/dev/null; then
-       update-initramfs -k all -u
+       update-initramfs -k all -u 1>&2
     elif command -v dracut >/dev/null; then
EOF




[2]
root@debian:~# LANG=C apt purge -y mandos-client
The following packages were automatically installed and are no longer required:
  cryptsetup  cryptsetup-initramfs  libavahi-common-data  libavahi-common3  
libavahi-core7  libgpgme11t64  libnl-3-200  libnl-route-3-200  ssh
Use 'apt autoremove' to remove them.

REMOVING:
  mandos-client*

Summary:
  Upgrading: 0, Installing: 0, Removing: 1, Not Upgrading: 0
  Freed space: 577 kB

(Reading database ... 38713 files and directories currently installed.)
Removing mandos-client (1.8.16-1.2) ...
+ set -e
+ update_initramfs
+ command -v update-initramfs
+ update-initramfs -k all -u
update-initramfs: Generating /boot/initrd.img-6.10.6-amd64
+ [ remove = purge ]
+ exit 0
(Reading database ... 38657 files and directories currently installed.)
Purging configuration files for mandos-client (1.8.16-1.2) ...
+ set -e
+ shred --remove /etc/keys/mandos/seckey.txt
+ rm --force /etc/mandos/plugin-runner.conf /etc/keys/mandos/pubkey.txt 
/etc/keys/mandos/seckey.txt /etc/keys/mandos/tls-privkey.pem 
/etc/keys/mandos/tls-pubkey.pem /etc/keys/mandos/dhparams.pem
+ update_initramfs
+ command -v update-initramfs
+ update-initramfs -k all -u
update-initramfs: Generating /boot/initrd.img-6.10.6-amd64
+ [ purge = purge ]
+ [ -e /usr/share/debconf/confmodule ]
+ . /usr/share/debconf/confmodule
+ [ !  ]
+ PERL_DL_NONLAZY=1
+ export PERL_DL_NONLAZY
+ [  ]
+ exec /usr/share/debconf/frontend /var/lib/dpkg/info/mandos-client.postrm purge
+ set -e
+ shred --remove /etc/keys/mandos/seckey.txt
+ :
+ rm --force /etc/mandos/plugin-runner.conf /etc/keys/mandos/pubkey.txt 
/etc/keys/mandos/seckey.txt /etc/keys/mandos/tls-privkey.pem 
/etc/keys/mandos/tls-pubkey.pem /etc/keys/mandos/dhparams.pem
+ update_initramfs
+ command -v update-initramfs
+ update-initramfs -k all -u
+ [ purge = purge ]
+ [ -e /usr/share/debconf/confmodule ]
+ . /usr/share/debconf/confmodule
+ [ ! 1 ]
+ [ -z  ]
+ exec
+ [  ]
+ exec
+ DEBCONF_REDIR=1
+ export DEBCONF_REDIR
+ db_purge
+ _db_cmd PURGE
+ _db_internal_IFS=

+ IFS=
+ printf %s\n PURGE
+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=20 Unsupported command "update-initramfs:" (full line was "update-initramfs: 
Generating /boot/initrd.img-6.10.6-amd64") received from confmodule.
+ return 20
dpkg: error processing package mandos-client (--purge):
 installed mandos-client package post-removal script subprocess returned error 
exit status 128
Errors were encountered while processing:
 mandos-client
Error: Sub-process /usr/bin/dpkg returned an error code (1)
root@debian:~#

Reply via email to