[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
10/11: ssh: Honor GUIX_DAEMON_SOCKET on the target machine.
From: |
guix-commits |
Subject: |
10/11: ssh: Honor GUIX_DAEMON_SOCKET on the target machine. |
Date: |
Sat, 8 May 2021 09:08:59 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 3270308eebe82075d2f02517c5a2b1599928495c
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Wed May 5 23:26:27 2021 +0200
ssh: Honor GUIX_DAEMON_SOCKET on the target machine.
Fixes <https://bugs.gnu.org/48240>.
Reported by Ricardo Wurmus <rekado@elephly.net>.
* guix/ssh.scm (remote-daemon-channel)[redirect]: Define
'connect-to-daemon'. Use the same-named procedure from (guix store)
when available, and honor GUIX_DAEMON_SOCKET.
---
guix/ssh.scm | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/guix/ssh.scm b/guix/ssh.scm
index b39b90f..77a9732 100644
--- a/guix/ssh.scm
+++ b/guix/ssh.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021, 2021 Ludovic Courtès
<ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -253,7 +253,22 @@ EXP never returns or calls 'primitive-exit' when it's
done."
(use-modules (ice-9 match) (rnrs io ports)
(rnrs bytevectors))
- (let ((sock (socket AF_UNIX SOCK_STREAM 0))
+ (define connect-to-daemon
+ ;; XXX: 'connect-to-daemon' used to be private and before that it
+ ;; didn't even exist, hence these shenanigans.
+ (let ((connect-to-daemon
+ (false-if-exception (module-ref (resolve-module '(guix store))
+ 'connect-to-daemon))))
+ (lambda (uri)
+ (if connect-to-daemon
+ (connect-to-daemon uri)
+ (let ((sock (socket AF_UNIX SOCK_STREAM 0)))
+ (connect sock AF_UNIX ,socket-name)
+ sock)))))
+
+ ;; Use 'connect-to-daemon' to honor GUIX_DAEMON_SOCKET.
+ (let ((sock (connect-to-daemon (or (getenv "GUIX_DAEMON_SOCKET")
+ socket-name)))
(stdin (current-input-port))
(stdout (current-output-port))
(select* (lambda (read write except)
@@ -272,8 +287,6 @@ EXP never returns or calls 'primitive-exit' when it's done."
(setvbuf stdin 'block 65536)
(setvbuf sock 'block 65536)
- (connect sock AF_UNIX ,socket-name)
-
(let loop ()
(match (select* (list stdin sock) '() '())
((reads () ())
- branch master updated (e118348 -> f903bb7), guix-commits, 2021/05/08
- 02/11: gnu: Add font-montserrat., guix-commits, 2021/05/08
- 01/11: gnu: ocaml: Depend on libiberty., guix-commits, 2021/05/08
- 04/11: gnu: Add volctl., guix-commits, 2021/05/08
- 03/11: gnu: xfce4-session: Allow xflock4 to use xset., guix-commits, 2021/05/08
- 06/11: weather: '--display-missing' shows the system type of missing items., guix-commits, 2021/05/08
- 11/11: services: configuration: Export 'no-serialization' syntactic keyword., guix-commits, 2021/05/08
- 05/11: gnu: volctl: Comment on the license., guix-commits, 2021/05/08
- 07/11: store: 'open-connection' never returns #f., guix-commits, 2021/05/08
- 08/11: ssh: 'connect-to-remote-daemon' raises a nicer message upon error., guix-commits, 2021/05/08
- 10/11: ssh: Honor GUIX_DAEMON_SOCKET on the target machine.,
guix-commits <=
- 09/11: store: Export 'connect-to-daemon'., guix-commits, 2021/05/08