GNU bug report logs - #74510
[PATCH] doc: Document the (possible) need for network-online for NFS.

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: guix-patches; Reported by: Tomas Volf <~@wolfsden.cz>; Keywords: patch; dated Sun, 24 Nov 2024 17:45:01 UTC; Maintainer for guix-patches is guix-patches@HIDDEN.

Message received at 74510 <at> debbugs.gnu.org:


Received: (at 74510) by debbugs.gnu.org; 25 Nov 2024 11:36:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 25 06:36:13 2024
Received: from localhost ([127.0.0.1]:38160 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tFXO0-0002kA-Kb
	for submit <at> 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 <at> 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=
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden
X-Spam-Level: 
X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED
 autolearn=ham autolearn_force=no version=3.4.6
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>
To: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
Subject: Re: [bug#74510] [PATCH] doc: Document the (possible) need for
 network-online for NFS.
In-Reply-To: <87o724nmr9.fsf@HIDDEN> (Maxim Cournoyer's message of "Mon, 25
 Nov 2024 10:08:26 +0900")
References: <2e43b85dce9d86ded76acc7acee234847c49a616.1732470232.git.~@wolfsden.cz>
 <87o724nmr9.fsf@HIDDEN>
Date: Mon, 25 Nov 2024 12:36:06 +0100
Message-ID: <87zflneeah.fsf@HIDDEN>
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-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 74510
Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, 74510 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

--=-=-=
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

Hello Maxim,

thank you for the review. :)  Responses below.

Maxim Cournoyer <maxim.cournoyer@HIDDEN> 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-----
--=-=-=--




Information forwarded to guix-patches@HIDDEN:
bug#74510; Package guix-patches. Full text available.

Message received at 74510 <at> debbugs.gnu.org:


Received: (at 74510) by debbugs.gnu.org; 25 Nov 2024 01:09:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 24 20:09:39 2024
Received: from localhost ([127.0.0.1]:36587 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tFNbf-0006HN-Ez
	for submit <at> debbugs.gnu.org; Sun, 24 Nov 2024 20:09:39 -0500
Received: from mail-pf1-f172.google.com ([209.85.210.172]:46484)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maxim.cournoyer@HIDDEN>) id 1tFNbc-0006HF-Tt
 for 74510 <at> debbugs.gnu.org; Sun, 24 Nov 2024 20:09:38 -0500
Received: by mail-pf1-f172.google.com with SMTP id
 d2e1a72fcca58-724f1ce1732so1032487b3a.1
 for <74510 <at> debbugs.gnu.org>; Sun, 24 Nov 2024 17:09:36 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1732496916; x=1733101716; darn=debbugs.gnu.org;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to;
 bh=o13DBrS0o4sFFsol0SMjThGdsuAiaA/2a43Z/iXaWs0=;
 b=X/LNExAFWIeg8HEtBmblE9J6n2sYyqe9SJbA5ZREH5By49p2f/IRtvYiy2pkOG9wea
 v7s1CyT34ZcN6hSBpDgcUf0Aa5BgZtsAOFmaDleGZD0LZYyoRO3X9RwypjYcfAwx1fPj
 YDyqe5gksVmm5EGmXAvoZAzLBw5ADmabnyy9S93MjbiPsC5a9tH1p4lGq1XvyFJCJts3
 5vUbyqPB6m8R8zWKOXYACr34U5vTtNFDLXFfu0eLfpBQgC6vSzyTK4MoHx205aQhCc0W
 7sopPmz+Eqxuc72ZMBxonOjVQv06wabXkhfmzP70JvstWpz3nXDm9hBZoHopmMuC0HrO
 jhww==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1732496916; x=1733101716;
 h=mime-version:user-agent:message-id:date:references:in-reply-to
 :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date
 :message-id:reply-to;
 bh=o13DBrS0o4sFFsol0SMjThGdsuAiaA/2a43Z/iXaWs0=;
 b=xSIz2K4E6cFqhRnp4Le5TQ2+DDp2C5RY2CS5kORgcqW5jDB4QtGAF6q4nFCkhXj4yU
 1/hsWYW4Qq9ya68MA+MDLgzFRu07NYCqUaXjb0DpF5BA6tu6U7GUJJ0QeESabEpbLBCA
 dY6/omBHI5sahD/uYfUUwy1pRxe1ctF+mb7vKqvSOleey1Nt5rtge1DzFcua4rlqyCIe
 Ns2Uaw/j3dgJx9x6HnXoGCe8Z7uxTFpsl71uGk8hG5FTJ/rhYYi7kxW/9ALzuXxPuSuv
 YFjrpYfFGHOgy+eHFvvcc1XniKG0YGURMuq5bEEKX83ZvK+9TAkqojVrZwtcX2lvX4cc
 CZTw==
X-Gm-Message-State: AOJu0Yy+pfp7lsm+oOXNUXsk6e00gu2YV1LDQTQCzJbaLXC+E8wor0to
 OuMSPy8fubzbGqhRWOPcdgBbPbOScZO8ppOhpsmnnYrlmuNLvsMdFe+EJ4Ms
X-Gm-Gg: ASbGncsZANj3jGeJGvH/86Q34mi7ndGBFcsqhi5KxcccCnnuzLxymHeocjqgoaZwWVm
 bskB2hXypMd+dT9l/8MbG5fXsT8m9XRlouvbNAxOTQwaWhKlimrxxi7cnbqg9KI3ooLm4JyibtD
 +S0IzsVWoqRJ6KEMvgpcLaDqAw/0aC2ZQ/eHcSrBuEu13Cf2d6VPvoCNVZJ7s5/tFyx0K0YyTGR
 Yph93AXLsJP0nWLrHN9PTrEvJA74PAQ+yBJIikCvd1B1Hg=
X-Google-Smtp-Source: AGHT+IEGS0xSaFBmiG3+6CUnxcZfyd44MkOwY5MOXKnkGml1dMB34i3UKQ0dSW2P4SdeuSjb8HgDYw==
X-Received: by 2002:a17:90b:4a51:b0:2ea:4e67:5638 with SMTP id
 98e67ed59e1d1-2eb0e884761mr14401134a91.35.1732496916043; 
 Sun, 24 Nov 2024 17:08:36 -0800 (PST)
Received: from terra ([2405:6586:be0:0:c8ff:1707:9b9:af89])
 by smtp.gmail.com with ESMTPSA id
 98e67ed59e1d1-2eb0d048c5fsm5454793a91.37.2024.11.24.17.08.34
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Sun, 24 Nov 2024 17:08:35 -0800 (PST)
From: Maxim Cournoyer <maxim.cournoyer@HIDDEN>
To: Tomas Volf <~@wolfsden.cz>
Subject: Re: [bug#74510] [PATCH] doc: Document the (possible) need for
 network-online for NFS.
In-Reply-To: <2e43b85dce9d86ded76acc7acee234847c49a616.1732470232.git.~@wolfsden.cz>
 (Tomas Volf's message of "Sun, 24 Nov 2024 18:43:52 +0100")
References: <2e43b85dce9d86ded76acc7acee234847c49a616.1732470232.git.~@wolfsden.cz>
Date: Mon, 25 Nov 2024 10:08:26 +0900
Message-ID: <87o724nmr9.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 74510
Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= <ludo@HIDDEN>, 74510 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Tomas,

Tomas Volf <~@wolfsden.cz> writes:

> Depending on networking is not enough in some setups, so a language clarifying
> that and an example of network-online service.
>
> * doc/guix.texi (File Systems): Document the possible need for network-online.
>
> 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?

> 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=0
> +while ! /run/setuid-programs/ping -qc1 -W1 example.org; do
> +	sleep 1
> +	[ \"$((c += 1))\" -lt 30 ] || exit 1  # Limit the wait time
> +done
> +")
> +                    (status (system cmd)))
> +               (= 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:

--8<---------------cut here---------------start------------->8---
(define (network-reachable?)
  "Return true if we can reach the Internet."
  (false-if-exception (getaddrinfo "www.gnu.org" "80" AI_NUMERICSERV)))
--8<---------------cut here---------------end--------------->8---

> +   ;; 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.

-- 
Thanks,
Maxim




Information forwarded to guix-patches@HIDDEN:
bug#74510; Package guix-patches. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 24 Nov 2024 17:44:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Nov 24 12:44:11 2024
Received: from localhost ([127.0.0.1]:35927 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tFGeY-0001nN-KF
	for submit <at> debbugs.gnu.org; Sun, 24 Nov 2024 12:44:10 -0500
Received: from lists.gnu.org ([209.51.188.17]:47878)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <~@wolfsden.cz>) id 1tFGeW-0001nD-5E
 for submit <at> debbugs.gnu.org; Sun, 24 Nov 2024 12:44:09 -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 <~@wolfsden.cz>) id 1tFGeV-0005A6-Q8
 for guix-patches@HIDDEN; Sun, 24 Nov 2024 12:44:07 -0500
Received: from wolfsden.cz ([37.205.8.62])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <~@wolfsden.cz>) id 1tFGeT-0000lC-Ne
 for guix-patches@HIDDEN; Sun, 24 Nov 2024 12:44:07 -0500
Received: by wolfsden.cz (Postfix, from userid 104)
 id D9E4E340AD3; Sun, 24 Nov 2024 17:44:02 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail;
 t=1732470242; bh=Th9BtisB1iGlfPrQK6xjRLrY+hba4He2l7Y4I6HET08=;
 h=From:To:Cc:Subject:Date;
 b=WHaZa9D3Bmovka4tSNZru+eOVTZnxfYxQQ5VE3yoclWitwIqDrQM36HolqjWeeMZB
 E2VWOWkSSKlmVgHWlI+rcPAJ3vSgDdkbh/Nztuq9327/SqZ6WPiIugdnlV7evIvW2T
 okMJbeC25pcQRtnlwGwc54lEv/7MVbBNr7hd/i5YySm7sVnMVYjSlezxdotZ/3UeuI
 tSTeHEg5CQULm/7eqhLzK/wISNWtHKC+9HKuAOPGqiUj0M/dqzdNRJldZ1uejGeerk
 4EucHzvaXg/xeQuHSYlzayQy77QlNVwNIvCA/OemVVDRzOsx78k890zZKz9Bw/wws9
 wpDHBAld2NX8+sd4T+55pDqZcdVQTrmPdSZE24B4QnCPiXIEmB4NV+mS96eeuu/gz4
 sGoahAyww+5d+O8BqbtKSadY+WlhBtWA1xArXIZBnm/ZQr5h/ZSMcHLzMp+sSCZt5D
 0VlfAvB5o5tELKCn92rpdWpTLN6Lg+f9P8ZdL8oXf+wsHnyXqvDIMoaQhlnXbVO8Mp
 4n4qIU+z8q3gnwlR6vabY0qfbCfXfEA1kbRhFmu73dVeate/YubSyPGNtZj0MJOLOl
 9AFr23HMxFbcnPcqMhOSzn2gEdtzRka+ULECfE3rKKAZh133+6da1on3WSMVdCqM7J
 +K7eJflR/710VShTjRTmJgHc=
X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on wolfsden
X-Spam-Level: 
X-Spam-Status: No, score=-3.1 required=5.0 tests=ALL_TRUSTED,BAYES_00,
 DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,URIBL_BLOCKED
 autolearn=ham autolearn_force=no version=3.4.6
Received: from localhost (unknown [128.0.188.242])
 by wolfsden.cz (Postfix) with ESMTPSA id 0B826341A87;
 Sun, 24 Nov 2024 17:44:01 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail;
 t=1732470242; bh=Th9BtisB1iGlfPrQK6xjRLrY+hba4He2l7Y4I6HET08=;
 h=From:To:Cc:Subject:Date;
 b=WHaZa9D3Bmovka4tSNZru+eOVTZnxfYxQQ5VE3yoclWitwIqDrQM36HolqjWeeMZB
 E2VWOWkSSKlmVgHWlI+rcPAJ3vSgDdkbh/Nztuq9327/SqZ6WPiIugdnlV7evIvW2T
 okMJbeC25pcQRtnlwGwc54lEv/7MVbBNr7hd/i5YySm7sVnMVYjSlezxdotZ/3UeuI
 tSTeHEg5CQULm/7eqhLzK/wISNWtHKC+9HKuAOPGqiUj0M/dqzdNRJldZ1uejGeerk
 4EucHzvaXg/xeQuHSYlzayQy77QlNVwNIvCA/OemVVDRzOsx78k890zZKz9Bw/wws9
 wpDHBAld2NX8+sd4T+55pDqZcdVQTrmPdSZE24B4QnCPiXIEmB4NV+mS96eeuu/gz4
 sGoahAyww+5d+O8BqbtKSadY+WlhBtWA1xArXIZBnm/ZQr5h/ZSMcHLzMp+sSCZt5D
 0VlfAvB5o5tELKCn92rpdWpTLN6Lg+f9P8ZdL8oXf+wsHnyXqvDIMoaQhlnXbVO8Mp
 4n4qIU+z8q3gnwlR6vabY0qfbCfXfEA1kbRhFmu73dVeate/YubSyPGNtZj0MJOLOl
 9AFr23HMxFbcnPcqMhOSzn2gEdtzRka+ULECfE3rKKAZh133+6da1on3WSMVdCqM7J
 +K7eJflR/710VShTjRTmJgHc=
From: Tomas Volf <~@wolfsden.cz>
To: guix-patches@HIDDEN
Subject: [PATCH] doc: Document the (possible) need for network-online for NFS.
Date: Sun, 24 Nov 2024 18:43:52 +0100
Message-ID: <2e43b85dce9d86ded76acc7acee234847c49a616.1732470232.git.~@wolfsden.cz>
X-Mailer: git-send-email 2.46.0
MIME-Version: 1.0
X-Debbugs-Cc: Ludovic Courtès <ludo@HIDDEN>, Maxim Cournoyer <maxim.cournoyer@HIDDEN>
Content-Transfer-Encoding: 8bit
Received-SPF: pass client-ip=37.205.8.62; envelope-from=~@wolfsden.cz;
 helo=wolfsden.cz
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 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_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
Cc: Tomas Volf <~@wolfsden.cz>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

Depending on networking is not enough in some setups, so a language clarifying
that and an example of network-online service.

* doc/guix.texi (File Systems): Document the possible need for network-online.

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.  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=0
+while ! /run/setuid-programs/ping -qc1 -W1 example.org; do
+	sleep 1
+	[ \"$((c += 1))\" -lt 30 ] || exit 1  # Limit the wait time
+done
+")
+                    (status (system cmd)))
+               (= 0 (status:exit-val status)))))
+   ;; Ordering for one-shot? services does not currently work.
+   ;; https://issues.guix.gnu.org/74284
+   ;; (one-shot? #t)
+   )))
+@end lisp
 
 Typically, file systems are mounted before most other Shepherd services
 are started.  However, file systems with a non-empty
-- 
2.46.0





Acknowledgement sent to Tomas Volf <~@wolfsden.cz>:
New bug report received and forwarded. Copy sent to ludo@HIDDEN, maxim.cournoyer@HIDDEN, guix-patches@HIDDEN. Full text available.
Report forwarded to ludo@HIDDEN, maxim.cournoyer@HIDDEN, guix-patches@HIDDEN:
bug#74510; Package guix-patches. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 12 Jan 2025 05:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.