summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
Diffstat (limited to 'gnu')
-rw-r--r--gnu/services/base.scm16
-rw-r--r--gnu/tests/base.scm17
2 files changed, 31 insertions, 2 deletions
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index c43f39fe320..062364bf81f 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -1557,7 +1557,21 @@ the tty to run, among other things."
1557 (string-append dir "/lib")) 1557 (string-append dir "/lib"))
1558 (list #$@name-services)) 1558 (list #$@name-services))
1559 ":"))))) 1559 ":")))))
1560 (stop #~(make-kill-destructor)) 1560 (stop #~(let ((terminate (make-kill-destructor)))
1561 (lambda (process)
1562 (terminate process)
1563
1564 ;; PID 1 might have mapped nscd database files via
1565 ;; '__nscd_get_mapping'. Call the relevant libc
1566 ;; functions (those with a corresponding GETFD* request
1567 ;; type) to cause PID 1 to notice that those mappings
1568 ;; are stale and to unmap them. Failure to do so would
1569 ;; prevent the root file system from being remounted
1570 ;; read-only when shutting down.
1571 (false-if-exception (getpw "root"))
1572 (false-if-exception (getgr "root"))
1573 (false-if-exception (getaddrinfo "localhost" "http"))
1574 #f)))
1561 (modules `((ice-9 popen) ;for the actions 1575 (modules `((ice-9 popen) ;for the actions
1562 (ice-9 rdelim) 1576 (ice-9 rdelim)
1563 (ice-9 match) 1577 (ice-9 match)
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index dc51880d8ed..86fa6374efc 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -827,6 +827,18 @@ in a loop. See <http://bugs.gnu.org/26931>.")
827 ,witness-size)))))) 827 ,witness-size))))))
828 marionette)) 828 marionette))
829 829
830 ;; Cause PID 1 to create a mapping to nscd's database files.
831 ;; Those mappings used to prevent 'root-file-system' to remount
832 ;; read-only on shutdown. See
833 ;; <https://codeberg.org/guix/guix/issues/4269>.
834 (test-equal "open libc NSS database"
835 "root"
836 (marionette-eval '(begin
837 (use-modules (gnu services herd))
838 (start-service 'nscd) ;wait for nscd
839 (eval-there '(passwd:name (getgr "root"))))
840 marionette))
841
830 ;; Halt the system. 842 ;; Halt the system.
831 (marionette-eval '(system* "/run/current-system/profile/sbin/halt") 843 (marionette-eval '(system* "/run/current-system/profile/sbin/halt")
832 marionette) 844 marionette)
@@ -891,7 +903,10 @@ in a loop. See <http://bugs.gnu.org/26931>.")
891 "Make sure the root file system is cleanly unmounted when the system is 903 "Make sure the root file system is cleanly unmounted when the system is
892halted.") 904halted.")
893 (value 905 (value
894 (let ((os (marionette-operating-system %simple-os))) 906 (let ((os (marionette-operating-system
907 %simple-os
908 #:imported-modules '((gnu services herd)
909 (guix combinators)))))
895 (run-root-unmount-test os))))) 910 (run-root-unmount-test os)))))
896 911
897 912