[lfs] branch trunk updated: systemd: run the test suite in a separate mount namespace

"Git Owner" ([email protected] via lfs-book Mailing List) <[email protected]>
Newsgroups gmane.linux.lfs.book
Message-ID <176986898456.24976.15012047966399566831@rivendell.linuxfromscratch.org>
This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch trunk
in repository lfs.

The following commit(s) were added to refs/heads/trunk by this push:
     new 2d0c43a31 systemd: run the test suite in a separate mount namespace
2d0c43a31 is described below

commit 2d0c43a315d6d2b0b2d676ba8109ca4ac0e3c24a
Author: Xi Ruoyao <[email protected]>
AuthorDate: Sat Jan 31 22:06:34 2026 +0800

    systemd: run the test suite in a separate mount namespace
    
    The systemd test suite creates a mountpoint in /tmp, causing an error in
    Cleaning Up at the end of Ch. 08:
    
        rm: cannot remove '/tmp/not-mounted-gQSHWD/regular': Device or resource busy
    
    Run the test suite in a separate mount namespace so the mount point gets
    invisible to everything except the test suite and cleaned up after the
    test suite finishes.
---
 chapter08/systemd.xml | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/chapter08/systemd.xml b/chapter08/systemd.xml
index 7fee06900..cbb43cd76 100644
--- a/chapter08/systemd.xml
+++ b/chapter08/systemd.xml
@@ -216,11 +216,16 @@ meson setup ..                \
 
 <screen><userinput remap="make">ninja</userinput></screen>
 
-    <para>Some tests need a basic <filename>/etc/os-release</filename> file.
-    To test the results, issue:</para>
+    <para>One test creates a mount point in
+    <filename class='directory'>/tmp</filename> that we cannot clean up so
+    easily after running the test suite, and some tests need a basic
+    <filename>/etc/os-release</filename> file.  To test the results, create
+    this file and run the test suite in a separate mount namespace (so the
+    mount point is only visible for the test suite and it gets cleaned up
+    automatically after the test suite finishes):</para>
 
 <screen><userinput remap="test">echo 'NAME="Linux From Scratch"' &gt; /etc/os-release
-ninja test</userinput></screen>
+unshare -m ninja test</userinput></screen>
 
     <!-- test-namespace needs /run/systemd/inaccessible/sock, which only exists
          after initializing the system with systemd.  -->

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

-- 
http://lists.linuxfromscratch.org/sympa/info/lfs-book
Unsubscribe: See the above information page
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.