From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 6H+WKXthRGehfwEAe85BDQ:P1 (envelope-from ) for ; Mon, 25 Nov 2024 11:37:31 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 6H+WKXthRGehfwEAe85BDQ (envelope-from ) for ; Mon, 25 Nov 2024 12:37:31 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=ffxo64CV; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=mKGymDhE; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=Vj7gmhd+; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=wolfsden.cz (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1732534651; a=rsa-sha256; cv=none; b=WT/M7xF4Pqm9mJ0rSBPSZ9xZjleV1y65+LVjSNKc4fDwMc+2Z3j9nE+MK8gvEUYwV9lqwB gAxBjSRLRyHSDDJL+pJDYDfQpyZgie+OJ5OH71df14KAoMEgy1YrP9MJt8O9d9D5AXzami YuFRf3D0XSIMty02jYuRZ74/3MBDZuiTe3qYCr8FFsgfXBVsZS+yLYWS8EHnI/0g4wxTU0 V3OfJUXe6lnKLgI5/C+Z9G/9Lut8u8w7eRc97GoDM7V03D/SVGaeF1N+jO7I+h6C2XZpi9 YSlR1hTBdbr/tXoMywnKVSPdThMbCR6C770rgg8DspA5MhMkKcVWFwVmhlv0Ww== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=ffxo64CV; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=mKGymDhE; dkim=fail ("headers rsa verify failed") header.d=wolfsden.cz header.s=mail header.b=Vj7gmhd+; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=wolfsden.cz (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1732534651; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=qKzCskU2X/kIuGqgsSrG7AlcIZnK2TMD9bmGuHlAij0=; b=S0uyEqby/Avp3G56yRz+He9C7V60FBgzNtL0bGq+qPlHGqaShO5AP67jBJ21+XjKDiLxMQ xdamNeu4LWhOWFvrb22htXVMDW7swYejdFYI9nzGxM5iHgbvHVpIKjWr+i6IFnez/sDxu/ 1JVJvhkaRNjEXIAaM6pZ9BgHUlQ+O2uw4/JCl5tkQXfBGQXReeOUhKG0f8SEySR2tHedYc nc2rT6SLV8p9uvQcJaa2i/hiFVwZ8Qzn08iMpqox3qffFNVDt02xtZZG5TVgRUGVBb+ofN SDAjl/mZ0vtACMLi9J2W+TqqV7sTLk6tEEq4EG6dfISESv/ycp6O8CNagMuH6A== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5C084200 for ; Mon, 25 Nov 2024 12:37:30 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFXOv-00082E-He; Mon, 25 Nov 2024 06:37:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tFXOo-00081T-Ds for guix-patches@gnu.org; Mon, 25 Nov 2024 06:37:04 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tFXOn-0004BY-TI for guix-patches@gnu.org; Mon, 25 Nov 2024 06:37:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=qKzCskU2X/kIuGqgsSrG7AlcIZnK2TMD9bmGuHlAij0=; b=ffxo64CVppOUeU566p9vV80MdNrv1wGVCKDLphyLt04bcaEt/ZxL9dYDAA/vKAsJPxAUtrfm2jVUQEwuM76bRtWAhh+DccdV2ZKsCOix3WRrWV2QDxKhu6vXwp9KWofpfk6XYbVXGRyInV1JE5SFIyXKEn7l98HsfWs2vTHNtswZxX6c3XzV19hTqcMwBLcG1nyr0xWxTA8PQ9eSCcXy7rEcfMHT0UOUNKJIbole8q+f6VA5XyqaiEpTH9SE46RiAeGWyMdy6+V0e1VzHG0/Ld0mK35uIhpcUjYan2Swi49EgGb5baiTJ4xzaYBVPG5hsBiSgxNBzI/U1C0a0WQbHA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tFXOn-0002li-Nv for guix-patches@gnu.org; Mon, 25 Nov 2024 06:37:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#74510] [PATCH] doc: Document the (possible) need for network-online for NFS. Resent-From: Tomas Volf <~@wolfsden.cz> Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 25 Nov 2024 11:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74510 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxim Cournoyer Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 74510@debbugs.gnu.org Received: via spool by 74510-submit@debbugs.gnu.org id=B74510.173253457310554 (code B ref 74510); Mon, 25 Nov 2024 11:37:01 +0000 Received: (at 74510) by debbugs.gnu.org; 25 Nov 2024 11:36:13 +0000 Received: from localhost ([127.0.0.1]:38160 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFXO0-0002kA-Kb for submit@debbugs.gnu.org; Mon, 25 Nov 2024 06:36:13 -0500 Received: from wolfsden.cz ([37.205.8.62]:57950) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1tFXNw-0002jw-UI for 74510@debbugs.gnu.org; Mon, 25 Nov 2024 06:36:11 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id 74FBC34679A; Mon, 25 Nov 2024 11:36:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1732534567; bh=P29K6S3LpAb+CSxrxJhDhryFD5M+RKjUgqux99X9NZM=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=mKGymDhEBFRmFx6ha6T7UjKaKKliZnXm/xL9xaJIoSaNmSMkx9ZDJC9WoRt0cayjv d08TdDkVs4VlUWeADfDAxdRL5nyVnlbvmvquPh9mD5iML3Dtx5sZyjwpkzZ/I9aBXK 2TdvaO8OfptLZDHoqPDwWxkfdJNQpLQOoyMeBoG1ner2KPzKscxZhS2bpuwgdGYUTB 7mXzvYviokAKnDIU+XWHpNZaXEFPYcidyuTA4O+JV58UPS2JaSDhF++cGOxdnrbRqR ZOQd8UbS/M4nR6BFwemN61NoFyLCmSeVKZ24GXk1HkyfCBhNGarA5ZDAcIghHq5X/A nfeezaS+7TxjCztrFk+L0BPaXFveZrmTz6PY2ss0mheZaH5jJWlT8u2At0KKhGsMlU B3g07O1XsbOvi4/9fFFgckPx+jlPASNm/TSz/eL4T1YBM+ePQPNsCz7Km/hrC9Rj7i mctLMQ9oeidSTEF+5/K3oz7eAimC3O51BvFNvBdD1cd0crJDV9B9rHAQX9Ps8vVIXu ftlgEa7JpEaLbhrPgUBElXfybdrGnWbDI6IFYgLXYP1oCA6PkjUygg+Y4BN6JgGhko PR9QRJL8UUJNB779OTOw2F94c30Z4FtA79Xsgki4bkdTetBeDEQoj2I2kPe0hL2O8J k5LwU4tqrTQcxYmIKD9bH46E= Received: from localhost (unknown [128.0.188.242]) by wolfsden.cz (Postfix) with ESMTPSA id 9C5A5345557; Mon, 25 Nov 2024 11:36:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1732534566; bh=P29K6S3LpAb+CSxrxJhDhryFD5M+RKjUgqux99X9NZM=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=Vj7gmhd+l3XvHRCImQ/vW7vVfZUh1q0th9cR5l29srLT1nb+ymbT2SOe1SPG4zvox TyDIU1Uu90pnsMhUSgEcUF5Lyu2VUN8f6HKmsk9DtGE3pJcvHB6DP7n3e0uTU60ZO8 Z8uJiGOUwFPE0xkFTjHCQobkdMykDbYcoc68qX5rYr+epMFeIxm7vFiKs70IzbTkxC lV/JPA960BtSwjAkWQIDocxhvS9X+sLlYt+aW79VpXDsmju68odBbBL4hU/wxBwKZQ NyJ77AUIIW1REaiDqyNsO3grcknl9syIdi65C/Q5mZusdSYQsCsXj/nTB2JhYv9Vzc OXnP1Tdi7gj7zv8CCdTC7pe1XzrbfC5OUIIVlPd/ESmfxQH4xzcTGqbE07dYKh3AJy mDMilmkwL6pK26gku1fqF9YIGpLEngSu1rcxKuVsE/1cn6lMlO373TFgEXbdAgmuJd pj/fnn+AY3QMCI8M5Q6LXJ7kM1tgYu6M0hBL4TSwd7n0H3ZRPbDe9wZkWiA45uVaqG teR6Dzy2CHWt6qAdkT3jpasc0pmcfTx3X8wQlQRpBXkG2mshnQxkru+PKVrxNtym4Z IfvdVAzrWUfyBa2toFekcr7LsUU2Q8fTmFJhRx3Cm9Tto8XdB79m/LmrGjct25RQWx Q45Gq3L0885dK4T1k9txcNeg= From: Tomas Volf <~@wolfsden.cz> In-Reply-To: <87o724nmr9.fsf@gmail.com> (Maxim Cournoyer's message of "Mon, 25 Nov 2024 10:08:26 +0900") References: <2e43b85dce9d86ded76acc7acee234847c49a616.1732470232.git.~@wolfsden.cz> <87o724nmr9.fsf@gmail.com> Date: Mon, 25 Nov 2024 12:36:06 +0100 Message-ID: <87zflneeah.fsf@wolfsden.cz> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 5C084200 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -10.90 X-Spam-Score: -10.90 X-TUID: dE/YLUqiLFQY --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hello Maxim, thank you for the review. :) Responses below. Maxim Cournoyer writes: > Hi Tomas, > > Tomas Volf <~@wolfsden.cz> writes: > >> Depending on networking is not enough in some setups, so a language clar= ifying >> that and an example of network-online service. >> >> * doc/guix.texi (File Systems): Document the possible need for network-o= nline. >> >> Change-Id: I8abe07cc9d6dc61f28eeea7ffa785eb8c9e8fd09 >> --- >> doc/guix.texi | 28 +++++++++++++++++++++++++++- >> 1 file changed, 27 insertions(+), 1 deletion(-) >> >> diff --git a/doc/guix.texi b/doc/guix.texi >> index 26488b41c8..861e78e6d2 100644 >> --- a/doc/guix.texi >> +++ b/doc/guix.texi >> @@ -18018,7 +18018,33 @@ File Systems >> met before mounting the file system. >> >> As an example, an NFS file system would typically have a requirement for >> -@code{networking}. >> +@code{networking}. However be aware that depending on @code{networking} >> +might not be sufficient in some setups and a variant of custom >> +@code{network-online} service might be necessary. > > Could we be more precise and detail a simple case or example of when > requiring 'network-online is needed over just 'network for NFS? It would be the case for any setup where 'networking being marked as started does not mean the network is fully configured. I personally encountered the issue with dhcp-client-service-type. I will send a v2 that will go into more details than "in some setups". > >> Example: >> + >> +@lisp >> +(simple-service 'network-online shepherd-root-service-type >> + (list >> + (shepherd-service >> + (requirement '(networking)) >> + (provision '(network-online)) >> + (documentation "Wait for the network to come up.") >> + (start #~(lambda _ >> + (let* ((cmd >> + "set -eux >> +c=3D0 >> +while ! /run/setuid-programs/ping -qc1 -W1 example.org; do >> + sleep 1 >> + [ \"$((c +=3D 1))\" -lt 30 ] || exit 1 # Limit the wait time >> +done >> +") >> + (status (system cmd))) >> + (=3D 0 (status:exit-val status))))) > > I'm pretty sure we have connectivity tests already in the Guix test > suite that must make use of Guile; that would be nicer, I think; for > example, the (guix tests) module has: > > (define (network-reachable?) > "Return true if we can reach the Internet." > (false-if-exception (getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV))) > This procedure however (despite the name) does not test whether network is reachable, it tests whether single specific host name is resolvable. That is not an equivalent of the example 'network-online service. 1. The procedure succeeds on completely offline machine, assuming there is a record for the host in /etc/hosts. This is not an hypothetical problem, in my configuration the actual host name I ping (instead of example.org above) *is* in /etc/hosts. 2. Even if the DNS server works, that does not mean that the route to the host being checked is configured (yet). That could happen when the route is (for example) created by VPN, so it needs some extra time to come up. I do not see a way to do a "ping" using Guile's standard library, and while I *could* implement it using raw sockets (the service is running as a root after all), that seems like an overkill for just an example snippet of code. I mean, I am not happy about shelling to the /run/setuid-programs/ping. But I did not figure out a Guile-only way to test what I want to test (specific host is reachable) that would fit in similar amount of code. What I could do is to replace the example with something like "Implementing the 'network-online service is left as an exercise to the reader.". Would that work for you? >> + ;; Ordering for one-shot? services does not currently work. >> + ;; https://issues.guix.gnu.org/74284 >> + ;; (one-shot? #t) >> + ))) >> +@end lisp > > Otherwise, it looks like a useful addition. Will send a v2 once we clarify what to do about the ping. Thanks, Tomas =2D-=20 There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJCBAEBCgAsFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmdEYSYOHH5Ad29sZnNk ZW4uY3oACgkQL7/ufbZ/wan3ohAAjP4Hhw1r9MQ+fiAqEyIq7NCG5GHXdNmXuOU/ L8f+8EpYnGtR/+qPWL9eI62JTbnec5NOqdnwfQ7C5rAYpVRH7UFfrzx66qyg0jAW fpwmwQmUQZsPpDiBscDAVhsIddCLYTpJ9Y9SM/DTw6q8b8QR8qplk6bnXTbaf8u8 sw7a+jTC4qQOS8M5s3QxE+1EFMeThlm1A2Tkig+OsaDVNX8z+0hj6OVakqhflyQO SeozxaPbL5gA9dB7rwhdMYEz5tFOFbRQoc73gJOx/Erjz3CjVeJNYz+bBIkkis/j wvmrRaXaOclmKgtE4eb3+iR+kxywsB9ZdlY1vdkeVOV2RAe4GSz3eehfqGR5op2x u21n2wZrOAHPFpZjz0rk1doavJHVv47nMs1YC3Bm8juZC/W7uZo4trA5EBny4f2F 4MrGEllwQUFfOh2XeZGFwhh2bHa9O1jV/n79goqfhVgE76ICwjjZU5Tcoa/w3QMY mcPUmHMcTnlD3p4ShZpiqIvC4GqFOjX2AVXYOwzOSlqlYTs4iEtDio1jysF4XKNN WeKjhE3gYBIggWyHEVCsxv+LMc9hB/5YR5Y+cwxhUiDE2MR3BXrptV3znjZI8e97 oYQuqlI4EaUYsXVhUlIBTgQy2ytkNpK8iQfmAd1kkErTlBzAAs9dvPqoxwUfeugn IBAm/iM= =Kg8W -----END PGP SIGNATURE----- --=-=-=--