Hi Ludo,

With the following patch

diff --git c/gnu/services/base.scm w/gnu/services/base.scm
index 8c6563c99d..c1c348116b 100644
--- c/gnu/services/base.scm
+++ w/gnu/services/base.scm
@@ -351,11 +351,35 @@ (define %root-file-system-shepherd-service
              ;; Return #f if successfully stopped.
              (sync)
 
+             (call-with-output-file "/dev/console" (lambda (port) (display 
"hello world after sync!\n" port) (force-output)))
+             
+
+             (format #t "processes: ~s~%" (processes))
              (let ((null (%make-void-port "w")))
                ;; Redirect the default output ports.
                (set-current-output-port null)
                (set-current-error-port null)
 
+               (call-with-output-file "/dev/console" (lambda (port) (display 
"hyllo world ports gone!\n" port) (force-output)))
+
+               (system* #$(file-append (@ (gnu packages lsof) lsof)
+                                       "/bin/lsof"))
+
+               (call-with-output-file "/dev/console" (lambda (port) (display 
"hello world after lsof!\n" port) (force-output)))
+               (call-with-output-file "/dev/console" (lambda (port) (display 
mount port) (force-output)))
+
+               (use-modules (ice-9 popen))
+               (use-modules (ice-9 rdelim))
+               (use-modules (ice-9 textual-ports))
+               (let* ((pipe (open-pipe* OPEN_READ #$(file-append (@ (gnu 
packages linux) psmisc) "/bin/fuser") "-wvm" "/"))
+                      (result (get-string-all pipe)))
+                 (call-with-output-file "/dev/console"
+                  (lambda (port)
+                    (display result port)
+                    (force-output))))
+
+               (call-with-output-file "/dev/console" (lambda (port) (display 
"hello world end!\n" port) (force-output)))
+
                ;; Close /dev/console.
                (for-each close-fdes '(0 1 2))
 
@@ -369,6 +393,12 @@ (define %root-file-system-shepherd-service
                                     #:update-mtab? #f)
                              #t)
                            (const #f))
+                   (when (zero? n)
+                     (call-with-output-file "/dev/console" (lambda (port) 
(display "hello world endless loop!\n" port) (force-output)))
+
+                     (let loop ((q 0))
+                       ((@ (fibers) sleep) 1)
+                       (loop (+ q 1))))
                    (unless (zero? n)
                      ;; Yield to the other fibers.  That gives logging fibers
                      ;; an opportunity to close log files so the 'mount' call

I get the following output (on the real laptop, on reboot):

hello world after sync!
hyllo world ports gone!
hello world after lsof!
#<procedure 7f7ddc08e7a0 at guix/build/syscalls.scm:573:4 ...>

And then it immediately reboots (I do reboot testing still--since my
debug-halt script causes the screen to go black immediately... wtf?).

So either lsof really outputs nothing or it's eaten by something.

In any case, the "mount" routine exists and is in scope.
I had wanted to verify that.

And then I get no output at all from fuser (I find that very unlikely).

"hello world end!" is not printed !!

"hello world endless loop!" is also not printed, and there's no endless
loop going on, so either the remount succeeded, or shepherd crashed.

So what I think happens is that shepherd crashes.  The same effect is
observable if I just invoke "kill 1".

The "processes:" line never appears anywhere in the output.

I made a photo of the screen just in time.  I'm very sure it's not there.

I think even the original problem (without any patch) could be that
the shepherd process just crashes.  The kernel doesn't take kindly to
that.

Reply via email to