guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/03: system: hurd: Use openssh-service; remove hurd-openssh-service.


From: guix-commits
Subject: 03/03: system: hurd: Use openssh-service; remove hurd-openssh-service.
Date: Mon, 13 Apr 2020 17:00:23 -0400 (EDT)

janneke pushed a commit to branch wip-hurd-vm
in repository guix.

commit 6ec746125b34cb5167a5dd5c766a7bb1a47f262e
Author: Jan (janneke) Nieuwenhuizen <address@hidden>
AuthorDate: Mon Apr 13 22:48:51 2020 +0200

    system: hurd: Use openssh-service; remove hurd-openssh-service.
    
    * gnu/system/hurd.scm (%base-services/hurd): Remove hurd-openssh-service.
    (%hurd-os): Add openssh-service.
    * gnu/services/hurd.scm (hurd-service->shepherd-service): Return
    openssh-shepherd-service for <openssh-configuration>, instead of
    hurd-shepherd-services.
    (hurd-openssh-service): Remove.
    (hurd-ssh-shepherd-service, hurd-ssh-service-type): Remove.
---
 gnu/services/hurd.scm | 78 +++------------------------------------------------
 gnu/system/hurd.scm   | 24 +++++++++-------
 2 files changed, 18 insertions(+), 84 deletions(-)

diff --git a/gnu/services/hurd.scm b/gnu/services/hurd.scm
index e0891d6..ef9c966 100644
--- a/gnu/services/hurd.scm
+++ b/gnu/services/hurd.scm
@@ -53,7 +53,7 @@
       (($ <guix-configuration>) (guix-shepherd-service config))
       (($ <hurd-console-configuration>) (hurd-console-shepherd-service config))
       (($ <hurd-ttys-configuration>) (hurd-ttys-shepherd-service config))
-      (($ <openssh-configuration>) (hurd-ssh-shepherd-service config))
+      (($ <openssh-configuration>) (openssh-shepherd-service config))
       (($ <syslog-configuration>) (syslog-shepherd-service config))
       (('loopback) (hurd-loopback-shepherd-service #f))
       (('user-processes) (hurd-user-processes-shepherd-service #f))
@@ -220,83 +220,13 @@ Hurd.")))
 
 
 ;;;
-;;; Simplified OpenSSH.  This removes loopback, syslogd and PAM dependencies.
-;;; This package will be removed when the Hurd supports those.
+;;; Bridge for OpenSSH.
 ;;;
 
 (define <openssh-configuration>
   (@@ (gnu services ssh) <openssh-configuration>))
 
-(define %openssh-accounts
-  (@@ (gnu services ssh) %openssh-accounts))
-
-(define openssh-activation
-  (@@ (gnu services ssh) openssh-activation))
-
-(define openssh-auto-start?
-  (@@ (gnu services ssh) openssh-auto-start?))
-
-(define openssh-config-file
-  (@@ (gnu services ssh) openssh-config-file))
-
-(define (hurd-ssh-configuration)
-  ((@@ (gnu services ssh) openssh-configuration)))
-
-(define openssh-configuration-openssh
-  (@@ (gnu services ssh) openssh-configuration-openssh))
-
-(define openssh-configuration-pid-file
-  (@@ (gnu services ssh) openssh-configuration-pid-file))
-
-(define extend-openssh-authorized-keys
-  (@@ (gnu services ssh) extend-openssh-authorized-keys))
-
-(define (hurd-ssh-shepherd-service config)
-  "Return a <shepherd-service> for openssh with CONFIG."
-
-  (define pid-file
-    (openssh-configuration-pid-file config))
-
-  (define openssh-command
-    #~(list
-       (string-append
-        #$(openssh-configuration-openssh config)
-        "/sbin/sshd")
-       "-D"
-       "-f" #$(openssh-config-file config)))
-
-  (list (shepherd-service
-         (documentation "OpenSSH server.")
-         (requirement '())
-         (provision '(ssh-daemon ssh sshd))
-         (start #~(make-forkexec-constructor
-                   #$openssh-command
-                   #:pid-file #$pid-file))
-         (stop #~(make-kill-destructor))
-         (auto-start? (openssh-auto-start? config)))))
-
-(define hurd-ssh-service-type
-  (service-type
-   (name 'openssh)
-   (description
-    "Run the OpenSSH secure shell (SSH) server, @command{sshd}.")
-   (extensions
-    (list (service-extension shepherd-root-service-type
-                             hurd-ssh-shepherd-service)
-          (service-extension activation-service-type
-                             openssh-activation)
-          (service-extension account-service-type
-                             (const %openssh-accounts))
-
-          ;; Install OpenSSH in the system profile.  That way,
-          ;; 'scp' is found when someone tries to copy to or from
-          ;; this machine.
-          (service-extension profile-service-type
-                             (lambda (config)
-                               (list (openssh-configuration-openssh
-                                      config))))))
-   (compose concatenate)
-   (extend  extend-openssh-authorized-keys)
-   (default-value (hurd-ssh-configuration))))
+(define openssh-shepherd-service
+  (@@ (gnu services ssh) openssh-shepherd-service))
 
 ;;; hurd.scm ends here
diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm
index 3e7ac51..b46714a 100644
--- a/gnu/system/hurd.scm
+++ b/gnu/system/hurd.scm
@@ -39,6 +39,7 @@
   #:use-module (gnu services shepherd)
   #:use-module (gnu services ssh)
   #:use-module (gnu system)
+  #:use-module (gnu system pam)
   #:use-module (gnu system shadow)
   #:use-module (gnu system vm)
   #:export (cross-hurd-image))
@@ -75,14 +76,6 @@
                  (hurd-console-configuration (hurd hurd)))
         (service hurd-ttys-service-type
                  (hurd-ttys-configuration (hurd hurd)))
-        (service hurd-ssh-service-type
-                 (openssh-configuration
-                  (use-pam? #f)
-                  (openssh openssh)
-                  (port-number 2222)
-                  (permit-root-login #t)
-                  (allow-empty-passwords? #t)
-                  (password-authentication? #t)))
         (service guix-service-type
                  (guix-configuration
                   (guix guix)
@@ -90,7 +83,9 @@
                                    "--disable-deduplication"
                                    "--max-jobs=1"))))
         (service hurd-console-service-type
-                 (hurd-console-configuration (hurd hurd) (fancy? #t)))))
+                 (hurd-console-configuration (hurd hurd) (fancy? #t)))
+        (service hurd-loopback-service-type)
+        (syslog-service)))
 
 (define %hurd-os
   (operating-system
@@ -103,7 +98,15 @@
     (timezone "GNUrope")
     (name-service-switch #f)
     (essential-services (hurd-essential-services this-operating-system))
-    (services %base-services/hurd)
+    (services (cons (service openssh-service-type
+                             (openssh-configuration
+                              (use-pam? #f)
+                              (openssh openssh)
+                              (port-number 2222)
+                              (permit-root-login #t)
+                              (allow-empty-passwords? #t)
+                              (password-authentication? #t)))
+                    %base-services/hurd))
     (pam-services '())
     (setuid-programs '())))
 
@@ -145,6 +148,7 @@ fi\n")))
         (account-service (append (operating-system-accounts os)
                                  (operating-system-groups os))
                          (operating-system-skeletons os))
+        (pam-root-service (operating-system-pam-services os))
         (hurd-etc-service os)
         (service profile-service-type
                  (operating-system-packages os))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]