AnswerBun.com

systemd networkd is restarted after systemctl stop

Server Fault Asked by barisdad on September 14, 2020

I have some python code that needs to change the configuration of a linux bond using systemd-networkd. I tried editing the .network and .netdev config files and restarting networkd but it doesn’t change the bond configuration.

What I want to do next is stop networkd, delete the bond and then start networkd again. The problem is that networkd is started as soon as I delete the bond. This is also reproducible via systemctl – /lib/systemd/systemd-networkd is started after the interface is deleted.

[email protected]:/# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.1  0.0  76864  2376 ?        Ss   05:54   0:00 /lib/systemd/systemd
root        21  0.0  0.0  70120  6452 ?        S<s  05:54   0:00 /lib/systemd/systemd-journald
root        22  0.0  0.0  24824   368 ?        Ss   05:54   0:00 /usr/bin/socat TCP-LISTEN:7272,reuseadd
message+    29  0.0  0.0  49928   508 ?        Ss   05:54   0:00 /usr/bin/dbus-daemon --system --address
systemd+    30  0.0  0.0  71968  1296 ?        Ss   05:54   0:00 /lib/systemd/systemd-networkd
root        33  0.3  0.0  18508  3424 pts/0    Ss   05:55   0:00 bash
root        43  0.0  0.0  34400  2848 pts/0    R+   05:55   0:00 ps aux
[email protected]:/# systemctl stop systemd-networkd
Warning: Stopping systemd-networkd.service, but it can still be activated by:
  systemd-networkd.socket
[email protected]:/# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0  76864  4408 ?        Ss   05:54   0:00 /lib/systemd/systemd
root        21  0.0  0.0  70120  6452 ?        S<s  05:54   0:00 /lib/systemd/systemd-journald
root        22  0.0  0.0  24824   368 ?        Ss   05:54   0:00 /usr/bin/socat TCP-LISTEN:7272,reuseadd
message+    29  0.0  0.0  49928   508 ?        Ss   05:54   0:00 /usr/bin/dbus-daemon --system --address
root        33  0.0  0.0  18508  3424 pts/0    Ss   05:55   0:00 bash
root        47  0.0  0.0  34400  2868 pts/0    R+   05:56   0:00 ps aux
[email protected]:/# ip link show mgmt
5: mgmt: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether fe:df:a1:cf:82:39 brd ff:ff:ff:ff:ff:ff
[email protected]:/# ip link del mgmt
[email protected]:/# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0  76864  4912 ?        Ss   05:54   0:00 /lib/systemd/systemd
root        21  0.0  0.0  70120  6452 ?        S<s  05:54   0:00 /lib/systemd/systemd-journald
root        22  0.0  0.0  24824   368 ?        Ss   05:54   0:00 /usr/bin/socat TCP-LISTEN:7272,reuseadd
message+    29  0.0  0.0  49928   508 ?        Ss   05:54   0:00 /usr/bin/dbus-daemon --system --address
root        33  0.0  0.0  18508  3424 pts/0    Ss   05:55   0:00 bash
systemd+    50  1.0  0.0  71968  5964 ?        Ss   05:57   0:00 /lib/systemd/systemd-networkd
root        51  0.0  0.0  34400  2924 pts/0    R+   05:57   0:00 ps aux
[email protected]:/# ip link show mgmt
13: mgmt: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1514 qdisc noqueue state UP mode DEFAULT group default qlen 1000
    link/ether fe:df:a1:cf:82:39 brd ff:ff:ff:ff:ff:ff```

One Answer

The warning displayed when stopping systemd-networkd.service explains the issue. "Warning: Stopping systemd-networkd.service, but it can still be activated by: systemd-networkd.socket"

If you want to prevent restarting, you need to stop the socket service as well.

systemctl stop systemd-networkd.socket

Answered by creztoe on September 14, 2020

Add your own answers!

Related Questions

Running python script in incrontab in Debian

2  Asked on November 14, 2021 by williammayor

       

LDAP auth fails for some users

1  Asked on November 14, 2021 by cyril-duchon-doris

     

mysqltuner script to optimize my mysql database

2  Asked on November 14, 2021 by maryb

 

Why is my mongo backup thrice my database size?

2  Asked on November 14, 2021 by m4ks

 

why opendkim says it isn’t running when it is

1  Asked on November 14, 2021 by francisaugusto

 

Yum: Can a package have a alias or short name?

1  Asked on November 14, 2021 by rubans

     

NGINX content disposition attachment not working on subdomain

1  Asked on November 14, 2021 by aseem-gautam

 

Upgrade image in a Deployment’s pods

1  Asked on November 12, 2021

 

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP