GNU bug report logs - #76688
[PATCH] services: network-manager: Handle existing configuration directory.

Previous Next

Package: guix-patches;

Reported by: 45mg <45mg.writes <at> gmail.com>

Date: Sun, 2 Mar 2025 18:33:02 UTC

Severity: normal

Tags: patch

Done: Vagrant Cascadian <vagrant <at> debian.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Vagrant Cascadian <vagrant <at> debian.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#76688: closed ([PATCH] services: network-manager: Handle
 existing configuration directory.)
Date: Sun, 23 Mar 2025 17:34:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sun, 23 Mar 2025 10:33:05 -0700
with message-id <87sen3ire6.fsf <at> wireframe>
and subject line Re: [bug#76688] [PATCH] services: network-manager: Handle existing configuration directory.
has caused the debbugs.gnu.org bug report #76688,
regarding [PATCH] services: network-manager: Handle existing configuration directory.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
76688: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=76688
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: 45mg <45mg.writes <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: 45mg <45mg.writes <at> gmail.com>
Subject: [PATCH] services: network-manager: Handle existing configuration
 directory.
Date: Sun,  2 Mar 2025 23:59:49 +0530
* gnu/services/networking.scm (network-manager-activation):
Handle the case where /etc/NetworkManager/conf.d already exists.

Change-Id: I7af4f4ad226eef28bd8667f0708525e77a6a50c8
---
Follow-up to 0caba8f5db48c15a2c3edae37e816654246fa986.

This issue only became apparent after pulling the above commit, changing my
system config to use the new extra-files field, and reconfiguring /twice/. This
sort of thing is why I now pull from a local fork and apply patches to it before
submitting them ;)

 gnu/services/networking.scm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 53840c2764..45efea330b 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -1271,7 +1271,18 @@ (define (network-manager-activation config)
                '((mkdir-p "/var/lib/misc"))
                '())
         #$@(if (pair? extra-configuration-files)  ;if non-empty
-               `((symlink
+               ;; If /etc/NetworkManager/conf.d is a symlink to a store file,
+               ;; delete it.
+               `((if (and (file-exists? "/etc/NetworkManager/conf.d")
+                          (store-file-name?
+                           (canonicalize-path "/etc/NetworkManager/conf.d")))
+                     (delete-file-recursively
+                      "/etc/NetworkManager/conf.d"))
+                 ;; If it exists but is not a symlink to a store file, then
+                 ;; this will fail with EEXIST; we leave this for the user to
+                 ;; handle, since they probably created the directory
+                 ;; themselves.
+                 (symlink
                   ,(file-union "network-manager-configuration-directory"
                                extra-configuration-files)
                   "/etc/NetworkManager/conf.d"))

base-commit: f9dcb84550b85aa816899b2106b1a5ae546167a3
-- 
2.48.1



[Message part 3 (message/rfc822, inline)]
From: Vagrant Cascadian <vagrant <at> debian.org>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: 76688-done <at> debbugs.gnu.org, Arnaud Daby-Seesaram <ds-ac <at> nanein.fr>,
 45mg <45mg.writes <at> gmail.com>
Subject: Re: [bug#76688] [PATCH] services: network-manager: Handle existing
 configuration directory.
Date: Sun, 23 Mar 2025 10:33:05 -0700
[Message part 4 (text/plain, inline)]
On 2025-03-22, Vagrant Cascadian wrote:
> On 2025-03-22, Maxim Cournoyer wrote:
>> Vagrant Cascadian <vagrant <at> debian.org> writes:
>>> I hit this bug as well, and it actually caused a boot failure, had to
>>> boot to an older generation to get things working again!
>>>
>>> Have not yet tried the patch, though it looks like it should fix this
>>> exact problem...
>
> I did get a chance to test the patch, and it worked to allow me to
> reconfigure multiple times and still be able to reboot into the new
> generation.

Given that the patch is a few weeks old, and it is a relatively new
feature, and not having it can trigger a boot failure, I went ahead and
pushed as a1e87abaa364f8391cfd1f49bb01876f7a730bfb services:
network-manager: Handle existing configuration directory.

live well,
  vagrant
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 56 days ago.

Previous Next


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