[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
15/22: DRAFT system: hurd: Start the Shepherd.
From: |
guix-commits |
Subject: |
15/22: DRAFT system: hurd: Start the Shepherd. |
Date: |
Mon, 13 Apr 2020 09:20:49 -0400 (EDT) |
janneke pushed a commit to branch wip-hurd-vm
in repository guix.
commit 1b2def51a692d6b12b07a164e9fb3aaeb23f6765
Author: Jan (janneke) Nieuwenhuizen <address@hidden>
AuthorDate: Sun Apr 12 17:34:25 2020 +0200
DRAFT system: hurd: Start the Shepherd.
This starts console, ttys, fancy-console, ssh-daemon, and guix-daemon using
the Shepherd. Shepherd is not running as PID 1 yet, its started from `rc'.
* gnu/packages/hurd.scm (hurd-rc-script): Do not start console, start the
shepherd instead.
* gnu/system/hurd.scm (shepherd.conf): New file.
---
gnu/packages/hurd.scm | 11 +++----
gnu/system/hurd.scm | 80 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 86 insertions(+), 5 deletions(-)
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index d187996..305f841 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -346,12 +346,13 @@ boot, since this cannot be done from GNU/Linux."
(apply invoke "settrans" "-c" node command))))
'#$translators)
- ;; Start the oh-so-fancy console client.
- (mkdir-p "/var/run") ;for the PID file
- (invoke "console" "--daemonize" "-c" "/dev/vcs"
- "-d" "vga" "-d" "pc_kbd" "-d" "generic_speaker")
;; Generate the ssh host keys.
- (invoke "/run/current-system/profile/bin/ssh-keygen" "-A"))))
+ (invoke "/run/current-system/profile/bin/ssh-keygen" "-A")
+ (mkdir-p "/var/run") ;for the PID files
+ ;; Hand over to the Shepherd
+ (false-if-exception (delete-file "/var/run/shepherd/socket"))
+ (invoke "/run/current-system/profile/bin/shepherd"
+ "--config" "/etc/shepherd.conf"))))
;; FIXME: We want the program to use the cross-compiled Guile when
;; cross-compiling. But why do we need to be explicit here?
diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm
index d346048..88c2557 100644
--- a/gnu/system/hurd.scm
+++ b/gnu/system/hurd.scm
@@ -150,6 +150,84 @@ PidFile /var/run/sshd.pid
PrintLastLog yes
LogLevel INFO\n"))
+ (define shepherd.conf
+ (plain-file "shepherd.conf"
+ ";; -*-scheme-*- # Generated by '(gnu system hurd)'
+;; shepherd --config /etc/shepherd.conf
+
+(use-modules (srfi srfi-1)
+ (srfi srfi-34)
+ (system repl error-handling)
+ (oop goops)
+ (shepherd service))
+
+(default-environment-variables
+ '(\"PATH=/run/current-system/profile/bin\"))
+(call-with-error-handling
+ (lambda _
+ (apply
+ register-services
+ (list
+ (make <service>
+ #:provides '(console)
+ #:respawn? #t
+ #:start (lambda _
+ (fork+exec-command
+ '(\"/run/current-system/profile/bin/console\"
+ \"-c\" \"/dev/vcs\"
+ \"-d\" \"vga\"
+ \"-d\" \"pc_kbd\"
+ \"-d\" \"generic_speaker\")))
+ #:stop (make-kill-destructor))
+ (make <service>
+ #:provides '(ttys)
+ #:requires '(console)
+ #:respawn? #t
+ #:start (lambda _
+ (fork+exec-command
+ '(\"/run/current-system/profile/libexec/runttys\")))
+ #:stop (make-kill-destructor))
+ (make <service>
+ #:provides '(fancy-console)
+ #:requires '(ttys)
+ #:respawn? #t
+ #:start (lambda _
+ (fork+exec-command
+ '(\"/run/current-system/profile/bin/console\"
+ \"-c\" \"/dev/vcs\"
+ \"-d\" \"vga\"
+ \"-d\" \"pc_kbd\"
+ \"-d\" \"generic_speaker\")))
+ #:stop (make-kill-destructor))
+ (make <service>
+ #:provides '(guix-daemon)
+ #:respawn? #t
+ #:start (lambda _
+ (fork+exec-command
+ '(\"/run/current-system/profile/bin/guix-daemon\"
+ \"--build-users-group=guixbuild\"
+ \"--disable-chroot\"
+ \"--disable-deduplication\"
+ \"--max-jobs=1\"
+ \"--substitute-urls=https://ci.guix.gnu.org\")))
+ #:stop (make-kill-destructor))
+ (make <service>
+ #:provides '(ssh-daemon ssh sshd)
+ #:respawn? #t
+ #:start (lambda _
+ (fork+exec-command
+ '(\"/run/current-system/profile/sbin/sshd\"
+ \"-D\"
+ \"-f\" \"/etc/ssh/sshd_config\")))
+ #:stop (make-kill-destructor))))))
+(format #t \"starting services...~%\")
+(for-each
+ (lambda (service)
+ (guard (c ((service-error? c) (format (current-error-port) \"failed to
start service '~a'~%\" service)))
+ (start service)))
+ '(console ttys fancy-console guix-daemon ssh-daemon ssh sshd))
+(redirect-port (open-input-file \"/dev/null\") (current-input-port))\n")) ;"
help Emacs
+
(define build.sh
(plain-file "build.sh"
"#! /bin/sh
@@ -226,6 +304,7 @@ guix build -e '(@@ (gnu packages commencement)
gnu-make-boot0)' --fallback --no-
"/etc/ttys"))
(directory "/etc/ssh")
("/etc/ssh/sshd_config" -> ,sshd_config)
+ ("/etc/shepherd.conf" -> ,shepherd.conf)
("/bin/sh" -> ,(file-append (with-parameters ((%current-target-system
"i586-pc-gnu"))
bash)
@@ -242,6 +321,7 @@ guix build -e '(@@ (gnu packages commencement)
gnu-make-boot0)' --fallback --no-
("etc-profile" ,etc-profile)
("shadow" ,shadow)
("sshd_config" ,sshd_config)
+ ("shepherd.conf" ,shepherd.conf)
("build.sh" ,build.sh))
#:copy-inputs? #t
#:os system-profile
- 10/22: gnu: hurd: Use default Qemu guest ip: 10.0.2.15., (continued)
- 10/22: gnu: hurd: Use default Qemu guest ip: 10.0.2.15., guix-commits, 2020/04/13
- 03/22: HACK build.sh, 2GiB disk., guix-commits, 2020/04/13
- 05/22: Revert "records: Have ABI check work well for cross-compilation.", guix-commits, 2020/04/13
- 02/22: system: hurd: Add guix., guix-commits, 2020/04/13
- 06/22: REMOVEME gnu: guix: Bugfix for cross compiling to the Hurd., guix-commits, 2020/04/13
- 04/22: Revert "compile: Run the load phase within 'with-target'.", guix-commits, 2020/04/13
- 08/22: build.sh: Disable daemon deduplication; builds gnu-make-boot0!, guix-commits, 2020/04/13
- 09/22: system: hurd: Bump image size to 10GiB., guix-commits, 2020/04/13
- 12/22: system: hurd: Add the Shepherd., guix-commits, 2020/04/13
- 11/22: system: hurd: Add openssh., guix-commits, 2020/04/13
- 15/22: DRAFT system: hurd: Start the Shepherd.,
guix-commits <=
- 18/22: services: Add hurd-ttys-service-type., guix-commits, 2020/04/13
- 14/22: gnu: python: Build fix for the Hurd., guix-commits, 2020/04/13
- 20/22: services: Register guix-daemon-service as a hurd service., guix-commits, 2020/04/13
- 16/22: services: Add hurd., guix-commits, 2020/04/13
- 13/22: gnu: coreutils: Mark three more tests XFAIL on the Hurd., guix-commits, 2020/04/13
- 19/22: services: Add hurd-user-services-service-type., guix-commits, 2020/04/13
- 21/22: system: hurd: Initial (gnu services) generated shepherd.conf., guix-commits, 2020/04/13
- 17/22: services: Add hurd-console-service-type., guix-commits, 2020/04/13
- 22/22: HACK use uncompiled .scm for shepherd, guix-commits, 2020/04/13