From unknown Thu Jun 19 14:04:24 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#56327 <56327@debbugs.gnu.org> To: bug#56327 <56327@debbugs.gnu.org> Subject: Status: Regression: openssh service fails to start if system has no IPv6 Reply-To: bug#56327 <56327@debbugs.gnu.org> Date: Thu, 19 Jun 2025 21:04:24 +0000 retitle 56327 Regression: openssh service fails to start if system has no I= Pv6 reassign 56327 guix submitter 56327 Andr=C3=A9 Batista severity 56327 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 30 15:20:55 2022 Received: (at submit) by debbugs.gnu.org; 30 Jun 2022 19:20:55 +0000 Received: from localhost ([127.0.0.1]:35631 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6zig-0006Yw-No for submit@debbugs.gnu.org; Thu, 30 Jun 2022 15:20:54 -0400 Received: from lists.gnu.org ([209.51.188.17]:43984) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6zif-0006Yo-32 for submit@debbugs.gnu.org; Thu, 30 Jun 2022 15:20:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50170) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6ziT-0005M4-Sz for bug-guix@gnu.org; Thu, 30 Jun 2022 15:20:49 -0400 Received: from mx0.riseup.net ([198.252.153.6]:48852) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o6ziO-0000a3-Rf for bug-guix@gnu.org; Thu, 30 Jun 2022 15:20:41 -0400 Received: from fews2.riseup.net (fews2-pn.riseup.net [10.0.1.84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.riseup.net", Issuer "R3" (not verified)) by mx0.riseup.net (Postfix) with ESMTPS id 4LYp802xJXz9tDJ for ; Thu, 30 Jun 2022 19:20:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1656616832; bh=0Z8gf8ocepXd7rxvydkY0oDiCZMpVZcLf0zc40j7hQ8=; h=Date:From:To:Subject:From; b=BfWMD6Fv34Cyc3/2wtJu9mUP/Y+Q+X0JzLqus8ZZo5h3E0kOS9PxxMXHtptV9frAV ZEP3ZZYzsZ2RHQI4FBouVIgwULc8SXQMT0Rcr23RCuj8UzhMBiifX3jsSvnBAM0Zs3 052s0ttja/6ILpZCcfbJrRdzc/qXrSzdCwfPS6QY= X-Riseup-User-ID: D469D57ED7CC1A5070472D2C657FF0133DAE4CCE6C222145F5731DC526C77A0C Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews2.riseup.net (Postfix) with ESMTPSA id 4LYp7z1hXZz1yWw for ; Thu, 30 Jun 2022 19:20:30 +0000 (UTC) Date: Thu, 30 Jun 2022 16:20:18 -0300 From: =?iso-8859-1?Q?Andr=E9?= Batista To: bug-guix@gnu.org Subject: Regression: openssh service fails to start if system has no IPv6 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Received-SPF: pass client-ip=198.252.153.6; envelope-from=nandre@riseup.net; helo=mx0.riseup.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) Hi Guix! Since commit d2b3400f79ffaed3357650307376ab69a7ec3b1b, ssh-daemon fails to start when the system is using shepherd 0.9.1, but has no support to IPv6. This is a result of shepherd trying to listen on a IPv6 address without prior checking. See https://issues.guix.gnu.org/55335. PS: Yeah, I know, it's 2022 and in a few months it will be 2023 and everyone's toilet should have its own IPv6 address by now and report its users health conditions to a plethora of pharmaceutical advertisers. Nonetheless, in this backward corner of the Earth there is still one guix machine without IPv6, believe it or not! :D From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 30 15:31:57 2022 Received: (at 56327) by debbugs.gnu.org; 30 Jun 2022 19:31:57 +0000 Received: from localhost ([127.0.0.1]:35637 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6ztM-0006sE-Qh for submit@debbugs.gnu.org; Thu, 30 Jun 2022 15:31:57 -0400 Received: from mx1.riseup.net ([198.252.153.129]:55184) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o6ztK-0006ry-Ee for 56327@debbugs.gnu.org; Thu, 30 Jun 2022 15:31:56 -0400 Received: from fews2.riseup.net (fews2-pn.riseup.net [10.0.1.84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.riseup.net", Issuer "R3" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4LYpP01DyXzDq8c for <56327@debbugs.gnu.org>; Thu, 30 Jun 2022 19:31:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1656617508; bh=6eejeDBzruGe199W+8cDP6npL6dnEVynzhbomcngWT8=; h=Date:From:To:Subject:References:In-Reply-To:From; b=cFWKQinkd/2o10AJQMf2Jl6VmJBX9gPfxq/c0V+jc2XKHSpHDPBmCFTHxjR+a84lB RZd5OSlcaQw0lf5sB6i6a7/cVMQDp29PAwu/qZEO99L4djhACf9vbUtQ8kE1peiGpC CzF8ZH3DEAovc+19P/DxSBvN6lnCMu+XVep8+cSo= X-Riseup-User-ID: 5610061A56C7126D31643D9D12E94BCD6EEF62FE3382C2335E8163D659D8A7E0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews2.riseup.net (Postfix) with ESMTPSA id 4LYpNy6lZvz1yWZ for <56327@debbugs.gnu.org>; Thu, 30 Jun 2022 19:31:46 +0000 (UTC) Date: Thu, 30 Jun 2022 16:31:41 -0300 From: =?iso-8859-1?Q?Andr=E9?= Batista To: 56327@debbugs.gnu.org Subject: Re: bug#56327: Regression: openssh service fails to start if system has no IPv6 Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="eKg6hZTwQ/6HTHjj" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 56327 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --eKg6hZTwQ/6HTHjj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline I've tested the following patch, which tests for IPv6 support, on both a system without IPv6 and another with it, but I have not tested on a system with shepherd < 0.9.1. Hopefuly it works as expected. Cheers! --eKg6hZTwQ/6HTHjj Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: attachment; filename="ssh-service.patch" Content-Transfer-Encoding: 8bit >From 30feda7b5ce8803b10e4bca8e86e1caaadc71596 Mon Sep 17 00:00:00 2001 In-Reply-To: References: From: =?UTF-8?q?Andr=C3=A9=20Batista?= Date: Thu, 30 Jun 2022 15:36:03 -0300 Subject: [PATCH] services: openssh: Check if IPv6 is supported and start service accordingly. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To: 56327@debbugs.gnu.org Fixes . Reported by André Batista . * gnu/services/ssh.scm (openssh-shepherd-service)[ipv6-support?]: New variable. : Use it. When using 'make-inetd-constructor', only pass a ipv6 endpoint if the system supports it. --- gnu/services/ssh.scm | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/gnu/services/ssh.scm b/gnu/services/ssh.scm index 57d3ad218c..050c3aa7c3 100644 --- a/gnu/services/ssh.scm +++ b/gnu/services/ssh.scm @@ -8,6 +8,7 @@ ;;; Copyright © 2020 Oleg Pykhalov ;;; Copyright © 2020 Brice Waegeneire ;;; Copyright © 2021 Tobias Geerinckx-Rice +;;; Copyright © 2022 André Batista ;;; ;;; This file is part of GNU Guix. ;;; @@ -536,23 +537,36 @@ (define inetd-style? #~(and (defined? 'make-inetd-constructor) (not (string=? (@ (shepherd config) Version) "0.9.0")))) + (define ipv6-support? + ;; Helper function to start/stop ssh service on systems with no IPv6. + ;; See https://issues.guix.gnu.org/56327. + #~(false-if-exception (socket AF_INET6 SOCK_STREAM 0))) + (list (shepherd-service (documentation "OpenSSH server.") (requirement '(syslogd loopback)) (provision '(ssh-daemon ssh sshd)) - (start #~(if #$inetd-style? - (make-inetd-constructor - (append #$openssh-command '("-i")) - (list (endpoint - (make-socket-address AF_INET INADDR_ANY - #$port-number)) - (endpoint - (make-socket-address AF_INET6 IN6ADDR_ANY - #$port-number))) - #:max-connections #$max-connections) - (make-forkexec-constructor #$openssh-command - #:pid-file #$pid-file))) + (start #~(cond ((and #$inetd-style? #$ipv6-support?) + (make-inetd-constructor + (append #$openssh-command '("-i")) + (list (endpoint + (make-socket-address AF_INET INADDR_ANY + #$port-number)) + (endpoint + (make-socket-address AF_INET6 IN6ADDR_ANY + #$port-number))) + #:max-connections #$max-connections)) + ((and #$inetd-style? (not #$ipv6-support?)) + (make-inetd-constructor + (append #$openssh-command '("-i")) + (list (endpoint + (make-socket-address AF_INET INADDR_ANY + #$port-number))) + #:max-connections #$max-connections)) + (else + (make-forkexec-constructor #$openssh-command + #:pid-file #$pid-file)))) (stop #~(if #$inetd-style? (make-inetd-destructor) (make-kill-destructor))) -- 2.36.0 --eKg6hZTwQ/6HTHjj-- From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 01 17:56:27 2022 Received: (at 56327-done) by debbugs.gnu.org; 1 Jul 2022 21:56:27 +0000 Received: from localhost ([127.0.0.1]:39274 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7Ocl-0008JF-4w for submit@debbugs.gnu.org; Fri, 01 Jul 2022 17:56:27 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41630) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7Oci-0008J0-Su for 56327-done@debbugs.gnu.org; Fri, 01 Jul 2022 17:56:25 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:40764) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7Ocd-0002fT-KJ; Fri, 01 Jul 2022 17:56:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=qKl3njMXPUykJGJ6e8cSaFoouSrV6wm6tZjogWuhypQ=; b=ivmoRftqFurMHOsw7g8W AMJAPBEX74BGa2m+0nw6lk+kYlLOsBiawcsFR5Q7rzTi+HXGt4O2v1KdvMvL2vceMXQPaQyskTVUI m8d2yvp7IHTM10O2XN4aDOfnU35atNbqMdHnvWujwr5Slmh3w3BZMscjjg0ah1dmCsqrl+dq7FrmA 6PrkCatOIN1NUsJ5y4TMQeayJdjrc0yuIcAPc2Ru84EPvC9stvT0H0MGPYoumsvqlGTcH2xL17br7 jZm+bsEAokzWGQy2AUMGRDu3nyRlm0y7LLO/BqIz4Jk0tiwMsPaBasSPLvzwx6VdyP+KG7mEhKXqp 0d8fKU9tDftATA==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:50444 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o7Ocd-0006aF-2y; Fri, 01 Jul 2022 17:56:19 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: =?utf-8?Q?Andr=C3=A9?= Batista Subject: Re: bug#56327: Regression: openssh service fails to start if system has no IPv6 References: Date: Fri, 01 Jul 2022 23:56:17 +0200 In-Reply-To: (=?utf-8?Q?=22Andr=C3=A9?= Batista"'s message of "Thu, 30 Jun 2022 16:31:41 -0300") Message-ID: <87zghs1oqm.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 56327-done Cc: 56327-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi! Andr=C3=A9 Batista skribis: > I've tested the following patch, which tests for IPv6 support, on > both a system without IPv6 and another with it, but I have not tested > on a system with shepherd < 0.9.1. Hopefuly it works as expected. Older versions of shepherd are not relevant in this case. I=E2=80=99ve fixed it slightly differently in commit bf7e07d299b197891110fbd8c717badbab06a472, to avoid a file descriptor leak. Thanks! Out of curiosity: I suppose you=E2=80=99re explicitly disabling IPv6 by usi= ng a custom kernel or with an activation snippet that fiddles with /proc or /sys, right? Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 01 20:27:52 2022 Received: (at 56327-done) by debbugs.gnu.org; 2 Jul 2022 00:27:52 +0000 Received: from localhost ([127.0.0.1]:39369 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7QzI-0003v1-DC for submit@debbugs.gnu.org; Fri, 01 Jul 2022 20:27:52 -0400 Received: from mx1.riseup.net ([198.252.153.129]:34920) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o7QzG-0003ul-Fm for 56327-done@debbugs.gnu.org; Fri, 01 Jul 2022 20:27:51 -0400 Received: from fews2.riseup.net (fews2-pn.riseup.net [10.0.1.84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mail.riseup.net", Issuer "R3" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4LZXw06G1ZzDqpK; Sat, 2 Jul 2022 00:27:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1656721664; bh=Kzg4BXRrp7ncwTBHYxlUNYXeYUoww9lF8YXE7yAQpQY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=H/FGrRKeunOhS4IeL07cBodq/r47iN7CGVO8C2vpbOaffRHr53YvAJsjzFz4bI4Qu zELqNLWvuTDPQ48PtPSgaupp1nEz7dLaARSiuq9PT6jbU2vVSk182Kzom5NQR01gYu pEL5SwUZiR7BJOCosij3hd/czM4KEllt1y5ofRh4= X-Riseup-User-ID: DE202BBD1D3EEC6A59394DF61122C2E455DA2721BFF27CDAB35A59CFA374E892 Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews2.riseup.net (Postfix) with ESMTPSA id 4LZXvz3NH7z214c; Sat, 2 Jul 2022 00:27:43 +0000 (UTC) Date: Fri, 1 Jul 2022 21:27:32 -0300 From: =?iso-8859-1?Q?Andr=E9?= Batista To: Ludovic =?iso-8859-1?Q?Court=E8s?= Subject: Re: bug#56327: Regression: openssh service fails to start if system has no IPv6 Message-ID: References: <87zghs1oqm.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87zghs1oqm.fsf@gnu.org> X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 56327-done Cc: 56327-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) sex 01 jul 2022 às 23:56:17 (1656730577), ludo@gnu.org enviou: > I’ve fixed it slightly differently in commit > bf7e07d299b197891110fbd8c717badbab06a472, to avoid a file descriptor > leak. Thanks! Tremendous difference, I'd say, both for closing the socket and for 'consing' the single test condition instead of the cumbersome repeated testing I had written. Thanks for lessoning me and for the quick fix! > Out of curiosity: I suppose you’re explicitly disabling IPv6 by using a > custom kernel or with an activation snippet that fiddles with /proc or > /sys, right? I am building a custom minimal kernel with 'CONFIG_IPV6=n'. Toutes mes amitiés! From unknown Thu Jun 19 14:04:24 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 30 Jul 2022 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator