Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

systemd-portabled: Failed to set up mount namespacing: File exists when using StateDirectory, LogsDirectory, etc #22264

Closed
Edu4rdSHL opened this issue Jan 27, 2022 · 3 comments · Fixed by #22272
Labels
bug 🐛 Programming errors, that need preferential fixing portable Anything to do with systemd-portable and portablectl and portables

Comments

@Edu4rdSHL
Copy link
Contributor

systemd version the issue has been seen with

systemctl --version
systemd 250 (250.3-1-arch)
+PAM +AUDIT -SELINUX -APPARMOR -IMA +SMACK +SECCOMP +GCRYPT +GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 -IDN +IPTC +KMOD +LIBCRYPTSETUP +LIBFDISK +PCRE2 -PWQUALITY +P11KIT -QRENCODE +BZIP2 +LZ4 +XZ +ZLIB +ZSTD -BPF_FRAMEWORK +XKBCOMMON +UTMP -SYSVINIT default-hierarchy=unified

Used distribution

  • ArchLinux

Linux kernel version used (uname -a)

  • Linux SecHackLabs 5.16.1-237-tkg-cfs-llvm #1 TKG SMP PREEMPT Wed, 19 Jan 2022 22:21:26 +0000 x86_64 GNU/Linux

CPU architecture issue was seen on

  • x86_64

Expected behaviour you didn't see

Unexpected behaviour you saw

  • The service failed with Failed to set up mount namespacing: File exists /usr/bin/$my_binary

Steps to reproduce the problem

  1. git clone https://github.com/Findomain/Findomain-Portable.git && cd Findomain-Portable
  2. mksquashfs rootfs/ findomain-portabled.raw -all-root -comp zstd
  3. systemctl start findomain-portabled.service
  4. journalctl -r # To see the error message.

Additional program output to the terminal or log subsystem illustrating the issue

  • unsquashfs -ll findomain-portabled.raw
drwxr-xr-x root/root               104 2022-01-26 16:17 squashfs-root
drwxr-xr-x root/root                33 2022-01-26 18:27 squashfs-root/dev
-rw-r--r-- root/root                 0 2022-01-26 18:27 squashfs-root/dev/.gitignore
drwxr-xr-x root/root                70 2022-01-26 16:49 squashfs-root/etc
-rw-r--r-- root/root                 0 2022-01-26 16:49 squashfs-root/etc/machine-id
-rw-r--r-- root/root               164 2022-01-26 16:22 squashfs-root/etc/os-release
-rw-r--r-- root/root                 0 2022-01-26 16:49 squashfs-root/etc/resolv.conf
drwxr-xr-x root/root                33 2022-01-26 18:27 squashfs-root/proc
-rw-r--r-- root/root                 0 2022-01-26 18:27 squashfs-root/proc/.gitignore
drwxr-xr-x root/root                33 2022-01-26 18:27 squashfs-root/run
-rw-r--r-- root/root                 0 2022-01-26 18:27 squashfs-root/run/.gitignore
drwxr-xr-x root/root                33 2022-01-26 18:27 squashfs-root/sys
-rw-r--r-- root/root                 0 2022-01-26 18:27 squashfs-root/sys/.gitignore
drwxr-xr-x root/root                33 2022-01-26 18:27 squashfs-root/tmp
-rw-r--r-- root/root                 0 2022-01-26 18:27 squashfs-root/tmp/.gitignore
drwxr-xr-x root/root                37 2022-01-26 16:17 squashfs-root/usr
drwxr-xr-x root/root                32 2022-01-26 16:24 squashfs-root/usr/bin
-rwxr-xr-x root/root          12495952 2022-01-26 16:24 squashfs-root/usr/bin/findomain
drwxr-xr-x root/root                30 2022-01-26 16:17 squashfs-root/usr/lib
drwxr-xr-x root/root                29 2022-01-26 16:17 squashfs-root/usr/lib/systemd
drwxr-xr-x root/root                50 2022-01-26 18:21 squashfs-root/usr/lib/systemd/system
-rw-r--r-- root/root               275 2022-01-26 18:21 squashfs-root/usr/lib/systemd/system/findomain-portabled.service
drwxr-xr-x root/root                37 2022-01-26 18:14 squashfs-root/var
drwxr-xr-x root/root                32 2022-01-26 18:14 squashfs-root/var/lib
drwxr-xr-x root/root                33 2022-01-26 18:28 squashfs-root/var/lib/findomain
-rw-r--r-- root/root                 0 2022-01-26 18:28 squashfs-root/var/lib/findomain/.gitignore
drwxr-xr-x root/root                33 2022-01-26 18:28 squashfs-root/var/tmp
-rw-r--r-- root/root                 0 2022-01-26 18:28 squashfs-root/var/tmp/.gitignore
Jan 26 18:50:13 SecHackLabs systemd[2649]: findomain-portabled.service: Failed to set up mount namespacing: File exists
Jan 26 18:50:13 SecHackLabs systemd[2649]: findomain-portabled.service: Failed at step NAMESPACE spawning /usr/bin/findomain: File exists
@gdamjan
Copy link
Contributor

gdamjan commented Jan 27, 2022

I can confirm the issue with systemd-git 250.r497.gf223fd6add-1-arch too

@Edu4rdSHL
Copy link
Contributor Author

I just have uploaded the findomain-portabled.raw image in case that someone want to reproduce the issue without building anything.

@yuwata yuwata added portable Anything to do with systemd-portable and portablectl and portables bug 🐛 Programming errors, that need preferential fixing labels Jan 27, 2022
bluca added a commit to bluca/systemd that referenced this issue Jan 27, 2022
…ectory are used

A bind mount is added directly from private on the host to the actual
destination directory, no need for the symlinks (which cannot be created
as the bind mount happens first and creates the target as an actual directory)

Fixes systemd#22264
@bluca
Copy link
Member

bluca commented Jan 27, 2022

Fix waiting in #22272

bluca added a commit to bluca/systemd that referenced this issue Jan 27, 2022
…ectory are used

A bind mount is added directly from private on the host to the actual
destination directory, no need for the symlinks (which cannot be created
as the bind mount happens first and creates the target as an actual directory)

Fixes systemd#22264
bluca added a commit to bluca/systemd that referenced this issue Jan 27, 2022
…ectory are used

A bind mount is added directly from private on the host to the actual
destination directory, no need for the symlinks (which cannot be created
as the bind mount happens first and creates the target as an actual directory)

Fixes systemd#22264
bluca added a commit to bluca/systemd that referenced this issue Jan 28, 2022
…ectory are used

A bind mount is added directly from private on the host to the actual
destination directory, no need for the symlinks (which cannot be created
as the bind mount happens first and creates the target as an actual directory)

Fixes systemd#22264
bluca added a commit to bluca/systemd that referenced this issue Jan 31, 2022
…ectory are used

A bind mount is added directly from private on the host to the actual
destination directory, no need for the symlinks (which cannot be created
as the bind mount happens first and creates the target as an actual directory)

Fixes systemd#22264

(cherry picked from commit 3fa80e5)
bluca added a commit to bluca/systemd that referenced this issue Jan 31, 2022
…ectory are used

A bind mount is added directly from private on the host to the actual
destination directory, no need for the symlinks (which cannot be created
as the bind mount happens first and creates the target as an actual directory)

Fixes systemd#22264

(cherry picked from commit 3fa80e5)
bluca added a commit to bluca/systemd that referenced this issue Jan 31, 2022
…ectory are used

A bind mount is added directly from private on the host to the actual
destination directory, no need for the symlinks (which cannot be created
as the bind mount happens first and creates the target as an actual directory)

Fixes systemd#22264

(cherry picked from commit 3fa80e5)
bluca added a commit to systemd/systemd-stable that referenced this issue Feb 15, 2022
…ectory are used

A bind mount is added directly from private on the host to the actual
destination directory, no need for the symlinks (which cannot be created
as the bind mount happens first and creates the target as an actual directory)

Fixes systemd/systemd#22264

(cherry picked from commit 3fa80e5)

Conflicts:
	test/units/testsuite-50.sh
bluca added a commit to bluca/systemd that referenced this issue Mar 4, 2022
…ectory are used

A bind mount is added directly from private on the host to the actual
destination directory, no need for the symlinks (which cannot be created
as the bind mount happens first and creates the target as an actual directory)

Fixes systemd#22264

(cherry picked from commit 3fa80e5)
bluca added a commit to bluca/systemd that referenced this issue Oct 3, 2022
…ectory are used

A bind mount is added directly from private on the host to the actual
destination directory, no need for the symlinks (which cannot be created
as the bind mount happens first and creates the target as an actual directory)

Fixes systemd#22264

(cherry picked from commit 3fa80e5)
bluca added a commit to bluca/systemd that referenced this issue Apr 21, 2023
…ectory are used

A bind mount is added directly from private on the host to the actual
destination directory, no need for the symlinks (which cannot be created
as the bind mount happens first and creates the target as an actual directory)

Fixes systemd#22264

(cherry picked from commit 3fa80e5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Programming errors, that need preferential fixing portable Anything to do with systemd-portable and portablectl and portables
Development

Successfully merging a pull request may close this issue.

4 participants