Activity log for bug #1979952

Date Who What changed Old value New value Message
2022-06-27 06:49:20 Philipp Wendler bug added bug
2022-07-26 14:38:42 Philipp Wendler bug watch added https://github.com/systemd/systemd/issues/24120
2022-07-26 14:38:42 Philipp Wendler bug task added systemd
2022-08-03 16:25:44 Nick Rosbrook tags rls-jj-incoming rls-kk-incoming
2022-08-04 15:19:12 Lukas Märdian systemd (Ubuntu): status New Triaged
2022-08-04 15:19:14 Lukas Märdian systemd (Ubuntu): importance Undecided Medium
2022-08-04 15:19:19 Lukas Märdian nominated for series Ubuntu Jammy
2022-08-04 15:19:19 Lukas Märdian bug task added systemd (Ubuntu Jammy)
2022-08-04 15:19:19 Lukas Märdian nominated for series Ubuntu Kinetic
2022-08-04 15:19:19 Lukas Märdian bug task added systemd (Ubuntu Kinetic)
2022-08-04 15:21:13 Matthieu Clemenceau tags rls-jj-incoming rls-kk-incoming fr-2591 rls-jj-incoming rls-kk-incoming
2022-08-04 15:21:13 Lukas Märdian tags fr-2591 rls-jj-incoming rls-kk-incoming
2022-08-16 21:42:54 Nick Rosbrook systemd (Ubuntu Kinetic): status Triaged In Progress
2022-08-16 21:47:08 Launchpad Janitor merge proposal linked https://code.launchpad.net/~enr0n/ubuntu/+source/systemd/+git/systemd/+merge/428423
2022-08-17 15:05:22 Nick Rosbrook description I have the following setup: - /data is an NFS mount. - /home is a bind mount to /data/home. Configured in /etc/fstab with these lines: $FILE_SERVER:/data /data nfs defaults 0 0 /data/home /home none bind,_netdev,x-systemd.requires-mounts-for=/data 0 0 This has worked with the same configuration for me on at least Ubuntu 18.04 and Ubuntu 20.04, but on Ubuntu 22.04 the mount of /home fails when attempted by systemd. So not only is /home not mounted after boot, but also when I run "sudo systemctl start home.mount", it fails. The journal entries are this: sudo[1316]: wendler : TTY=pts/0 ; PWD=/home/wendler ; USER=root ; COMMAND=/usr/bin/systemctl start home.mount sudo[1316]: pam_unix(sudo:session): session opened for user root(uid=0) by wendler(uid=1000) systemd[1]: home.mount: Directory /home to mount over is not empty, mounting anyway. systemd[1]: home.mount: Failed to make bind mount source '/data/home': Permission denied systemd[1]: home.mount: Failed to run 'mount' task: Permission denied systemd[1]: home.mount: Failed with result 'resources'. systemd[1]: Failed to mount /home. However, when I run "sudo mount /home" it works. Now the weird thing is that after I have mounted /home manually once and unmounted it again, then "sudo systemctl start home.mount" suddenly also works! But of course only until the next reboot. And even if I just do "ls /data" once (either as root or as my user), it also makes "sudo systemctl start home.mount" start working! To be fully clear: - Booting the system (/home fails to mount) - sudo systemctl start home.mount # fails - sudo ls /data # shows correct output - sudo systemctl start home.mount # works! Additional information: The NFS export for /data has root_squash set and if I remove this option, the bind mount of /home works as it should. However, both /data and /data/home have mode rwxr-xr-x, so root is able to enter and read these directories even despite root_squash. It is not a network or mount-order problem. Not only is the bind mount to /home correctly attempted after /data is mounted during boot, remember that the bind mount also fails when I try it with "sudo systemctl start home.mount" minutes afterwards. Versions (system is a recent installation with all updates applied): - Ubuntu 22.04 - Linux 5.15.0-40-generic - systemd 249.11-0ubuntu3.3 - util-linux 2.37.2-4ubuntu3 This appears on both Ubuntu 22.04 machines that I have (a hardware machine and a VM). [Impact] Some NFS setups that have worked on previous versions of Ubuntu are now broken. Specifically, when creating a bind mount, systemd will fail if the directory already exists on NFS. [Test Plan] This test plan requires an NFS server to be in place. The exact setup is not important, but for the purposes of this test plan we will assume the server exports /data, which contains a directory called home. * Make sure nfs-common is installed: $ apt install nfs-common -y * Check the NFS server exports using showmount: $ showmount -e $NFS_SERVER_IP Export list for $NFS_SERVER_IP: /data * * Add the appropriate entries to /etc/fstab. In this example, we will make /home2 a bind mount to /data/home: # /etc/fstab $NFS_SERVER_IP:/data /data nfs defaults,nfsvers=3 0 0 /data/home /home2 none bind,_netdev,x-systemd.requires-mounts-for=/data 0 0 * Check systemctl status home2.mount. On an affected system, we should see a permission denied error: $ systemctl status home2.mount x home2.mount - /home2 Loaded: loaded (/etc/fstab; generated) Active: failed (Result: resources) Where: /home2 What: /data/home Docs: man:fstab(5) man:systemd-fstab-generator(8) systemd[1]: home2.mount: Failed to make bind mount source '/data/home': Permission denied systemd[1]: home2.mount: Failed to run 'mount' task: Permission denied systemd[1]: home2.mount: Failed with result 'resources'. systemd[1]: Failed to mount /home2. * On a patched system, we expect /home2 to be mounted successfully. [Where problems could occur] The patch makes it so that systemd will not fail bind mounts immediately if creating the directory fails. Thus, any regressions would be seen during bind mounts with systemd. N.B. that this patch restores previous behavior in systemd. [Original Description] I have the following setup: - /data is an NFS mount. - /home is a bind mount to /data/home. Configured in /etc/fstab with these lines: $FILE_SERVER:/data /data nfs defaults 0 0 /data/home /home none bind,_netdev,x-systemd.requires-mounts-for=/data 0 0 This has worked with the same configuration for me on at least Ubuntu 18.04 and Ubuntu 20.04, but on Ubuntu 22.04 the mount of /home fails when attempted by systemd. So not only is /home not mounted after boot, but also when I run "sudo systemctl start home.mount", it fails. The journal entries are this: sudo[1316]: wendler : TTY=pts/0 ; PWD=/home/wendler ; USER=root ; COMMAND=/usr/bin/systemctl start home.mount sudo[1316]: pam_unix(sudo:session): session opened for user root(uid=0) by wendler(uid=1000) systemd[1]: home.mount: Directory /home to mount over is not empty, mounting anyway. systemd[1]: home.mount: Failed to make bind mount source '/data/home': Permission denied systemd[1]: home.mount: Failed to run 'mount' task: Permission denied systemd[1]: home.mount: Failed with result 'resources'. systemd[1]: Failed to mount /home. However, when I run "sudo mount /home" it works. Now the weird thing is that after I have mounted /home manually once and unmounted it again, then "sudo systemctl start home.mount" suddenly also works! But of course only until the next reboot. And even if I just do "ls /data" once (either as root or as my user), it also makes "sudo systemctl start home.mount" start working! To be fully clear: - Booting the system (/home fails to mount) - sudo systemctl start home.mount # fails - sudo ls /data # shows correct output - sudo systemctl start home.mount # works! Additional information: The NFS export for /data has root_squash set and if I remove this option, the bind mount of /home works as it should. However, both /data and /data/home have mode rwxr-xr-x, so root is able to enter and read these directories even despite root_squash. It is not a network or mount-order problem. Not only is the bind mount to /home correctly attempted after /data is mounted during boot, remember that the bind mount also fails when I try it with "sudo systemctl start home.mount" minutes afterwards. Versions (system is a recent installation with all updates applied): - Ubuntu 22.04 - Linux 5.15.0-40-generic - systemd 249.11-0ubuntu3.3 - util-linux 2.37.2-4ubuntu3 This appears on both Ubuntu 22.04 machines that I have (a hardware machine and a VM).
2022-08-30 20:59:55 Nick Rosbrook systemd (Ubuntu Kinetic): status In Progress Fix Released
2022-08-30 21:01:57 Nick Rosbrook systemd (Ubuntu Jammy): status New Fix Committed
2022-09-05 08:57:13 Łukasz Zemczak bug added subscriber Ubuntu Stable Release Updates Team
2022-09-05 08:57:15 Łukasz Zemczak bug added subscriber SRU Verification
2022-09-05 08:57:17 Łukasz Zemczak tags verification-needed verification-needed-jammy
2022-09-05 14:40:23 Philipp Wendler systemd (Ubuntu Jammy): status Fix Committed Invalid
2022-09-05 14:40:34 Philipp Wendler systemd (Ubuntu Jammy): status Invalid Fix Committed
2022-09-05 14:41:09 Philipp Wendler tags verification-needed verification-needed-jammy verification-done-jammy verification-needed
2022-09-07 23:25:32 Brian Murray systemd (Ubuntu Jammy): importance Undecided Medium
2022-09-12 00:04:14 Matthieu Clemenceau tags verification-done-jammy verification-needed foundations-todo verification-done-jammy verification-needed
2022-09-12 00:04:26 Matthieu Clemenceau bug added subscriber Ubuntu Foundations Team
2022-09-12 16:25:42 Łukasz Zemczak tags foundations-todo verification-done-jammy verification-needed foundations-todo verification-needed verification-needed-jammy
2022-09-12 19:32:13 Nick Rosbrook tags foundations-todo verification-needed verification-needed-jammy foundations-todo verification-done verification-done-jammy
2022-09-15 15:37:08 Matthieu Clemenceau removed subscriber Ubuntu Foundations Team
2022-09-15 15:37:16 Matthieu Clemenceau bug added subscriber Ubuntu Foundations Bugs
2022-09-22 09:08:57 Launchpad Janitor systemd (Ubuntu Jammy): status Fix Committed Fix Released
2022-09-22 09:09:26 Łukasz Zemczak removed subscriber Ubuntu Stable Release Updates Team
2022-09-28 16:19:54 Benjamin Drung tags foundations-todo verification-done verification-done-jammy verification-done verification-done-jammy