Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The networkd.service isn't masked (disabled) when installing network-manager by preload #167

Open
LaiderLai opened this issue Jan 18, 2024 · 5 comments
Assignees

Comments

@LaiderLai
Copy link

LaiderLai commented Jan 18, 2024

There is an issue scenario from core20/core22 with the latest snapd and network-manager. (including x86/arm64)

If users install network-manager by sudo snap install, the default networkd related services are disabled correctly.
However, if users preload network-manager by model assertion, the networked related services still work there.

It means the networked and network-manager are working at the same time on a platform and it may bring out some problems.
Not sure if the handling is broken at core-base or snaps. Need core-base/snapd developer help to check it. Tks.

@ernestl
Copy link
Contributor

ernestl commented Jan 25, 2024

Created Jira card to investigate: https://warthogs.atlassian.net/browse/SNAPDENG-14960

@alfonsosanchezbeato
Copy link
Member

Probably canonical/netplan#449 would help with this - my guess is that networkd is getting control of the interface while it shouldn't.

@LaiderLai
Copy link
Author

LaiderLai commented Sep 5, 2024

@alfonsosanchezbeato Thanks for your effort.
I saw the canonical/netplan#449 is merged and included in netplan v1.1 version, which is public in the Oracular.
However, this issue happened with Ubuntu Core, and Core24 isn't built with Oracular resources. We can't verify whether the solution is work.

But there is another #214 that is merged too as a workaround for core22.
However, we checked the preload issue is not fixed. The networked service still working with network-manager service at the same time.

2 PRs' logic is the same. Checking networked configurations to restart networked if any change.
Therefore, I don't think the issue is fixed. We still need the time to analyze why preload flow doesn't remove networked service as install flow. Tks.

@LaiderLai LaiderLai changed the title The networkd.service isn't removed when installing network-manager by preseed The networkd.service isn't removed when installing network-manager by preload Sep 5, 2024
@alfonsosanchezbeato
Copy link
Member

@LaiderLai to be clear, the networkd service cannot be removed when network-manager is installed as it is part of the base. It may even be started at some times as it is socket activated. What should not happen is that it takes control of devices if NM is around (unless configured to do so). Therefore, networkctl should only show unmanaged devices. If you see something else then there is a bug, otherwise there is not even if networkd is running.

@LaiderLai
Copy link
Author

Hi @alfonsosanchezbeato , sorry, I think I used the wrong words to make you misunderstand.
The problem should be the "networkd.service isn't masked when installing network-manager by preload"

Please reference the below operation log between 2 UC22 images.
A. UC22 image didn't preload network-manager
B. UC22 image preloaded network-manager by model assertion

For A, the systemd-networkd.service is working as expected.
Then systemd-networkd.service be disabled after the network-manager is installed.
But I'm not sure who uses what method to disable the systemd-networkd.service.
Because there is no systemd-networkd.* symlink under /etc/systemd/system can be removed.

After a system reboot, the systemd-networkd.service is under inactive status as expected.

For B, it's a weird scenario.
Even though the network-manager is installed, the systemd-networkd.service is enabled.
But the 2nd bootup will be changed to disabled status as the A's network-manager installed status.
Finally, the 3rd bootup is aligned to A's reboot status (systemd-networkd.service inactive).

Do you have any idea about this scenario?

[A]
$ systemctl status systemd-networkd.service
● systemd-networkd.service - Network Configuration
     Loaded: loaded (/lib/systemd/system/systemd-networkd.service; enabled-runtime; vendor preset: enabled)
     Active: active (running) since Fri 2024-09-06 02:10:19 UTC; 2min 1s ago
TriggeredBy: ● systemd-networkd.socket
       Docs: man:systemd-networkd.service(8)
   Main PID: 891 (systemd-network)
     Status: "Processing requests..."
      Tasks: 1 (limit: 2295)
     Memory: 1.4M
        CPU: 30ms
     CGroup: /system.slice/systemd-networkd.service
             └─891 /lib/systemd/systemd-networkd
$ systemctl status systemd-networkd.socket
● systemd-networkd.socket - Network Service Netlink Socket
     Loaded: loaded (/lib/systemd/system/systemd-networkd.socket; disabled; vendor preset: enabled)
     Active: active (running) since Fri 2024-09-06 03:30:42 UTC; 1min 0s ago
   Triggers: ● systemd-networkd.service
       Docs: man:systemd-networkd.service(8)
             man:rtnetlink(7)
     Listen: route 1361 (Netlink)
     CGroup: /system.slice/systemd-networkd.socket
$ sudo snap install network-manager
network-manager (22/stable) 1.36.6-12 from Canonical✓ installed
$ systemctl status systemd-networkd.service
● systemd-networkd.service - Network Configuration
     Loaded: loaded (/lib/systemd/system/systemd-networkd.service; disabled; vendor preset: enabled)
     Active: active (running) since Fri 2024-09-06 02:12:51 UTC; 1min 50s ago
TriggeredBy: ● systemd-networkd.socket
       Docs: man:systemd-networkd.service(8)
   Main PID: 1797 (systemd-network)
     Status: "Processing requests..."
      Tasks: 1 (limit: 2295)
     Memory: 1.3M
        CPU: 30ms
     CGroup: /system.slice/systemd-networkd.service
             └─1797 /lib/systemd/systemd-networkd
$ systemctl status systemd-networkd.socket
● systemd-networkd.socket - Network Service Netlink Socket
     Loaded: loaded (/lib/systemd/system/systemd-networkd.socket; disabled; vendor preset: enabled)
     Active: active (running) since Fri 2024-09-06 03:30:42 UTC; 4min 33s ago
   Triggers: ● systemd-networkd.service
       Docs: man:systemd-networkd.service(8)
             man:rtnetlink(7)
     Listen: route 1361 (Netlink)
     CGroup: /system.slice/systemd-networkd.socket
$ sudo reboot

[A. after reboot once]
$ systemctl status systemd-networkd.service
○ systemd-networkd.service - Network Configuration
     Loaded: loaded (/lib/systemd/system/systemd-networkd.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
TriggeredBy: ○ systemd-networkd.socket
       Docs: man:systemd-networkd.service(8)
$ systemctl status systemd-networkd.socket
○ systemd-networkd.socket - Network Service Netlink Socket
     Loaded: loaded (/lib/systemd/system/systemd-networkd.socket; disabled; vendor preset: enabled)
     Active: inactive (dead)
   Triggers: ● systemd-networkd.service
       Docs: man:systemd-networkd.service(8)
             man:rtnetlink(7)
     Listen: route 1361 (Netlink)

====================================

[B. 1st boot]
$ systemctl status systemd-networkd.service
● systemd-networkd.service - Network Configuration
     Loaded: loaded (/lib/systemd/system/systemd-networkd.service; enabled-runtime; vendor preset: enabled)
     Active: active (running) since Fri 2024-09-06 02:58:57 UTC; 2min 1s ago
TriggeredBy: ● systemd-networkd.socket
       Docs: man:systemd-networkd.service(8)
   Main PID: 1299 (systemd-network)
     Status: "Processing requests..."
      Tasks: 1 (limit: 2295)
     Memory: 2.9M
        CPU: 46ms
     CGroup: /system.slice/systemd-networkd.service
             └─1299 /lib/systemd/systemd-networkd
$ systemctl status systemd-networkd.socket
● systemd-networkd.socket - Network Service Netlink Socket
     Loaded: loaded (/lib/systemd/system/systemd-networkd.socket; disabled; vendor preset: enabled)
     Active: active (running) since Fri 2024-09-06 03:23:11 UTC; 24s ago
   Triggers: ● systemd-networkd.service
       Docs: man:systemd-networkd.service(8)
             man:rtnetlink(7)
     Listen: route 1361 (Netlink)
     CGroup: /system.slice/systemd-networkd.socket
$ sudo reboot

[B. 2nd boot]
$ systemctl status systemd-networkd.service
● systemd-networkd.service - Network Configuration
     Loaded: loaded (/lib/systemd/system/systemd-networkd.service; disabled; vendor preset: enabled)
     Active: active (running) since Fri 2024-09-06 03:01:51 UTC; 5min ago
TriggeredBy: ● systemd-networkd.socket
       Docs: man:systemd-networkd.service(8)
   Main PID: 1306 (systemd-network)
     Status: "Processing requests..."
      Tasks: 1 (limit: 2295)
     Memory: 1.3M
        CPU: 32ms
     CGroup: /system.slice/systemd-networkd.service
             └─1306 /lib/systemd/systemd-networkd
$ systemctl status systemd-networkd.socket
● systemd-networkd.socket - Network Service Netlink Socket
     Loaded: loaded (/lib/systemd/system/systemd-networkd.socket; disabled; vendor preset: enabled)
     Active: active (running) since Fri 2024-09-06 03:24:43 UTC; 1min 12s ago
   Triggers: ● systemd-networkd.service
       Docs: man:systemd-networkd.service(8)
             man:rtnetlink(7)
     Listen: route 1361 (Netlink)
     CGroup: /system.slice/systemd-networkd.socket
$ sudo reboot

[B. 3rd boot]
$ systemctl status systemd-networkd.service
○ systemd-networkd.service - Network Configuration
     Loaded: loaded (/lib/systemd/system/systemd-networkd.service; disabled; vendor preset: enabled)
     Active: inactive (dead)
TriggeredBy: ○ systemd-networkd.socket
       Docs: man:systemd-networkd.service(8)
$ systemctl status systemd-networkd.socket
○ systemd-networkd.socket - Network Service Netlink Socket
     Loaded: loaded (/lib/systemd/system/systemd-networkd.socket; disabled; vendor preset: enabled)
     Active: inactive (dead)
   Triggers: ● systemd-networkd.service
       Docs: man:systemd-networkd.service(8)
             man:rtnetlink(7)
     Listen: route 1361 (Netlink)

@LaiderLai LaiderLai changed the title The networkd.service isn't removed when installing network-manager by preload The networkd.service isn't masked (disabled) when installing network-manager by preload Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants