Bug 691549

Summary: NM startup is not right.
Product: [Fedora] Fedora Reporter: Bill Nottingham <notting>
Component: NetworkManagerAssignee: Dan Williams <dcbw>
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 15CC: amcnabb, cra, dcbw, k.georgiou, lpoetter, mschmidt, rvokal, walters
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-04-06 17:56:55 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Bill Nottingham 2011-03-28 19:52:57 UTC
Right now, we have:

/lib/systemd/system/NetworkManager.service:
[Unit]
Description=Network Manager
After=syslog.target

[Service]
Type=dbus
BusName=org.freedesktop.NetworkManager
ExecStart=/usr/sbin/NetworkManager --no-daemon

[Install]
WantedBy=network.target multi-user.target
Alias=dbus-org.freedesktop.NetworkManager.service

/usr/share/dbus-1/system-services/org.freedesktop.NetworkManager.service:
# This D-Bus service activation file is only for systemd support since
# an auto-activated NetworkManager would be quite surprising for those people
# who have NM installed but turned off.  Thus the Exec path available to
# D-Bus is /bin/false, but systemd knows the real Exec path due to the NM
# systemd .service file.

[D-BUS Service]
Name=org.freedesktop.NetworkManager
Exec=/bin/false
User=root
SystemdService=dbus-org.freedesktop.NetworkManager.service

However, this does not work in the way that we expect, or need.

An example, starting with NM running:

# systemctl stop NetworkManager.service

<stops it>

# systemctl disable NetworkManager.service
rm '/etc/systemd/system/dbus-org.freedesktop.NetworkManager.service'
rm '/etc/systemd/system/network.target.wants/NetworkManager.service'
rm '/etc/systemd/system/multi-user.target.wants/NetworkManager.service'

# dbus-send --system --dest=org.freedesktop.NetworkManager /org/freedesktop/NetworkManager org.freedesktop.NetworkManager.BeefyMiracle

<NetworkManager is started>

We really don't want it to bus activate, especially when it's explicitly disabled. Right now, it does. (Starting nm-applet will do it too.)

This behavior can be stopped by removing the dbus system-services file; this, however, removes all dbus activation in systemd.

Comment 1 Colin Walters 2011-03-30 16:22:55 UTC
Note this would all be sane if RPMs *never* enabled services, and they just got explicitly enabled by the OS installer.

Comment 2 Michal Schmidt 2011-03-31 11:21:55 UTC
I am unable to reproduce this. After the dbus-send call, NM is not started. /var/log/messages says:

dbus: [system] Activating via systemd service name='org.freedesktop.NetworkManager' unit='dbus-org.freedesktop.NetworkManager.service'
dbus: [system] Activation via systemd failed for unit 'dbus-org.freedesktop.NetworkManager.service': Unit dbus-org.freedesktop.NetworkManager.service failed to load: No such file or directory. See system logs and 'systemctl status' for details.

... which is as expected.

Comment 3 Michal Schmidt 2011-03-31 11:24:34 UTC
(In reply to comment #0)
> # systemctl stop NetworkManager.service
> 
> <stops it>
> 
> # systemctl disable NetworkManager.service

To avoid a race, you should disable first, then stop. Otherwise the D-Bus activation may come in between.

Comment 4 Michal Schmidt 2011-04-04 21:46:31 UTC
Bill, can you still reproduce this? Do you have a log with systemd.log_level=debug from the time of the unwanted activation?
When you reproduce this, where in the cgroup hierarchy do you see the NM process (use systemd-cgls)? Is it a member of NetworkManager.service or dbus.service?

Comment 5 Bill Nottingham 2011-04-05 18:24:12 UTC
I can't reproduce it at the moment with systemd-22-1 + NM-0.8.997. 

When filed, I was on systemd-20, so it's possible that something was fixed since then.

The dbus command now gives:

Error: org.freedesktop.systemd1.LoadFailed: Unit dbus-org.freedesktop.NetworkManager.service failed to load. No such file or directory.

which, while correct, isn't the most clear error to give.

Comment 6 Dan Williams 2011-04-06 16:22:04 UTC
So is this fixed then?  Should we close or is there something we still need to do in NM?

Comment 7 Michal Schmidt 2011-04-06 17:56:55 UTC
Let's close this.

Reopen if you can reproduce the bug. Preferably with information requested in comment #4 attached.