Subject: Re: bug#34580: Service ssh-daemon could not be started

From: Ludovic Courtès <[email-masked]>
Date: Thu, 26 Sep 2019 22:48:58 +0200

Hi Brand,

"Brant Gardner" <[email-masked]> skribis:

> I'll cheerfully do the experiment, but I don't know how - can you direct me for how to add strace where you need it to a booting system?

You could try something like the patch below.  When ‘ssh-daemon’ fails
to start, you’ll have to make sure to grab /tmp/ssh.log.

I’ve just experienced it on a headless machine so I sympathize all the
more now…

HTH!

Ludo’.

--- a/gnu/services/ssh.scm
+++ b/gnu/services/ssh.scm
@@ -23,6 +23,7 @@
 (define-module (gnu services ssh)
   #:use-module (gnu packages ssh)
   #:use-module (gnu packages admin)
+  #:use-module (gnu packages linux)
   #:use-module (gnu services)
   #:use-module (gnu services shepherd)
   #:use-module (gnu system pam)
@@ -491,7 +492,8 @@ of user-name/file-like tuples."
     (openssh-configuration-pid-file config))
 
   (define openssh-command
-    #~(list (string-append #$(openssh-configuration-openssh config) "/sbin/sshd")
+    #~(list #$(file-append strace "/bin/strace") "-f" "-s" "300" "-Tt" "-o" "/tmp/ssh.log"
+            (string-append #$(openssh-configuration-openssh config) "/sbin/sshd")
             "-D" "-f" #$(openssh-config-file config)))
 
   (list (shepherd-service