Comment 8 for bug 1848923

Revision history for this message
Christian Ehrhardt  (paelzer) wrote :

Awesome debugging Martin!

but while I agree that:
  CacheDirectory=pollinate
would in your case mitigate the issue by systemd providing that directory, it would also hide that this dir was lost at some point. The postinst of pollinate would have created that dir:

root@h:~# grep cache /var/lib/dpkg/info/pollinate.*
/var/lib/dpkg/info/pollinate.postinst: adduser --disabled-password --quiet --system --home /var/cache/$PKG --ingroup daemon --shell /bin/false $PKG
/var/lib/dpkg/info/pollinate.postinst:mkdir -p /var/cache/$PKG
/var/lib/dpkg/info/pollinate.postinst:chown -f $PKG /var/cache/$PKG
/var/lib/dpkg/info/pollinate.postinst:rm -f /var/cache/$PKG/tag

And only on remove it is removed, which didn't happen here:
/var/lib/dpkg/info/pollinate.postrm: rm -rf /var/lib/$PKG /var/cache/$PKG /etc/default/$PKG

And if we examine the groovy image that you referred at https://cloud-images.ubuntu.com/daily/server/groovy/current/groovy-server-cloudimg-amd64.img it has that path and would therefore not be affected.
Here as example:
$ wget https://cloud-images.ubuntu.com/daily/server/groovy/current/groovy-server-cloudimg-amd64.img
...
2021-02-08 16:00:56 (7,71 MB/s) - ‘groovy-server-cloudimg-amd64.img’ saved [562692096/562692096]
$ modprobe nbd max_part=8
$ sudo qemu-nbd --connect=/dev/nbd0 /tmp/groovy-server-cloudimg-amd64.img
[sudo] password for paelzer:
$ sudo fdisk /dev/nbd0 -l
Disk /dev/nbd0: 2,2 GiB, 2361393152 bytes, 4612096 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 063C6DF3-80DF-451F-8EA3-60CA46A6188F

Device Start End Sectors Size Type
/dev/nbd0p1 227328 4612062 4384735 2,1G Linux filesystem
/dev/nbd0p14 2048 10239 8192 4M BIOS boot
/dev/nbd0p15 10240 227327 217088 106M EFI System

Partition table entries are not in disk order.
$ mkdir /tmp/imagedisk
$ sudo mount /dev/nbd0p1 /tmp/imagedisk
$ sudo chroot /tmp/imagedisk
root@Keschdeichel:/# ll /var/cache/pollinate/
total 8
drwxr-xr-x 2 pollinate daemon 4096 Feb 7 11:32 ./
drwxr-xr-x 12 root root 4096 Feb 7 11:32 ../
root@Keschdeichel:/# exit

Could that be an issue in the creation of the cockpit images that you mentioned?
Where could we download one of them to check the state of that path in there?