To be specific, the override I would suggest is:

$ mkdir -p /etc/tmpfiles.d
$ cat > /etc/tmpfiles.d/tmp.conf << EOF
D /tmp 1777 root root 10d
q /var/tmp 1777 root root 30d
EOF

In particular, this is flipping the 'q' to a 'D' for the /tmp line.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/2080972

Title:
  /tmp as non-tmpfs doesn't get cleaned upon reboot

Status in systemd package in Ubuntu:
  Invalid

Bug description:
  On Oracular, it seems `/tmp` doesn't get cleaned on reboot, when the
  `/etc/systemd/system/tmp.mount` file is present.

  Reproducer:

  $ wget 
https://cloud-images.ubuntu.com/minimal/daily/oracular/20240913/oracular-minimal-cloudimg-amd64.img
  $ qemu-img resize oracular-minimal-cloudimg-amd64.img +20G
  $ cat >user-data <<EOF
  #cloud-config
  password: ubuntu
  chpasswd: { expire: False }
  ssh_pwauth: True
  EOF
  $ cloud-localds user-data.img user-data
  $ kvm -m 2G -smp 2 -hda oracular-minimal-cloudimg-amd64.img -hdb user-data.img

  In the VM, logged in with `ubuntu`/`ubuntu`:
  $ sudo touch /etc/systemd/system/tmp.mount
  $ df -h | grep '/tmp'  # you can verify that /tmp is a tmpfs, because this is 
the default now
  $ sudo systemctl reboot
  # Wait for reboot, then login again
  $ echo Hello there >/tmp/will_stay
  $ df -h | grep '/tmp'  # you can verify that /tmp is not a tmpfs anymore
  $ sudo systemctl reboot
  # Wait for reboot again, then login again
  $ cat /tmp/will_stay
  Hello there

  
  At least our auto-upgrade-testing tooling relies on `/tmp` getting cleaned 
upon reboot, and as a user, this is what I expect too.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2080972/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to