Bug 978026 - NetworkManager dispatcher unit file preset has wrong unit file name
Summary: NetworkManager dispatcher unit file preset has wrong unit file name
Keywords:
Status: CLOSED DUPLICATE of bug 977433
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 948433
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-06-25 20:23 UTC by Dan Williams
Modified: 2013-06-26 08:05 UTC (History)
12 users (show)

Fixed In Version:
Clone Of: 948433
Environment:
Last Closed: 2013-06-26 08:05:01 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Dan Williams 2013-06-25 20:23:50 UTC
+++ This bug was initially created as a clone of Bug #948433 +++

Currently nm_dispatcher is being forked off dbus-daemon by dbus's own activation logic. It would be a good thing if nm_dispatcher would be turned into its own systemd service instead, so that it can be introspected and controlled like any other system service, gets its own set of indexed logs, and so on. nm_dispatcher is currently one of the very few services we install by default that isn't a systemd service of its own.

Please make the following changes:

Add the following line to /usr/share/dbus-1/system-services/org.freedesktop.nm_dispatcher.service:

<snip>
SystemdService=dbus-org.freedesktop.nm-dispatcher.service
</snip>

Then, introduce /usr/lib/systemd/system/nm_dispatcher.service in your RPM:

<snip>
[Unit]
Description=Network Managing Dispatcher Service

[Service]
Type=dbus
BusName=org.freedesktop.nm_dispatcher
ExecStart=/usr/libexec/nm-dispatcher.action

[Install]
WantedBy=multi-user.target
Alias=dbus-org.freedesktop.nm-dispatcher.service
</snip>

Finally, add the snippets listed in https://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Systemd to you spec file:

<snip>
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd

[...]

%post
%systemd_post nm_dispatcher.service

%preun
%systemd_preun nm_dispatcher.service

%postun
%systemd_postun
</snip>

I will add nm_dispatcher.service to the preset file we ship, to ensure it is enabled by default.

Of course, please consider doing this changes together with those suggested in https://bugzilla.redhat.com/show_bug.cgi?id=787314#c37 -- in that case you can (and should) merge the macro lines above, to include the three unit names in the same line:

%systemd_post NetworkManager.service NetworkManager-wait-online.service nm_dispatcher.service

and

%systemd_preun NetworkManager.service NetworkManager-wait-online.service nm_dispatcher.service

--- Additional comment from Dan Williams on 2013-05-15 07:27:42 CDT ---

I've actually got plans to just merge the dispatcher back into NM for a variety of reasons, so I'm not sure we should bother to systemd-ize it at this point?  I'm not 100% sure when those changes would land though, possibly not by F19, so perhaps we do just systemd-ize it and then remove it again for F20?

--- Additional comment from Dan Williams on 2013-05-15 10:32:49 CDT ---

Built for F20; F19 will follow soon. NetworkManager-0.9.9.0-2.git20130515.fc20

--- Additional comment from Fedora Update System on 2013-06-07 17:28:38 CDT ---

NetworkManager-0.9.8.2-1.fc19,network-manager-applet-0.9.8.2-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/NetworkManager-0.9.8.2-1.fc19,network-manager-applet-0.9.8.2-1.fc19

--- Additional comment from Fedora Update System on 2013-06-08 22:28:18 CDT ---

NetworkManager-0.9.8.2-1.fc19, network-manager-applet-0.9.8.2-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

--- Additional comment from Berend De Schouwer on 2013-06-11 02:43:02 CDT ---

Scripts in /etc/NetworkManager/dispatcher.d/ no longer run.  I assume it's related to this (it appears related to NetworkManager-0.9.8.2-1.fc19)

I need a custom one for the corporate network when the laptop connects.

$ systemctl status dbus-org.freedesktop.nm-dispatcher.service
dbus-org.freedesktop.nm-dispatcher.service
   Loaded: error (Reason: No such file or directory)
   Active: inactive (dead)

%systemd_post seems to only run on install, not on upgrade of NetworkManager.

/usr/lib/systemd/system/nm_dispatcher.service doesn't exist, but 
/usr/share/dbus-1/system-services/org.freedesktop.nm_dispatcher.service references it.  /usr/lib/systemd/system/NetworkManager-dispatcher.service exists instead.

/usr/libexec/nm-dispatcher.action exists and references /etc/NetworkManager/dispatcher.d

/usr/bin/systemctl preset NetworkManager.service NetworkManager-wait-online.service NetworkManager-dispatcher.service doesn't seem to work.  It's still dbus-org.freedesktop.nm-dispatcher.service no such file or directory.

--- Additional comment from Berend De Schouwer on 2013-06-24 08:08:40 CDT ---

I think I fixed the dispatcher with:

sudo systemctl enable NetworkManager-dispatcher.service 

which created:

ln -s '/usr/lib/systemd/system/NetworkManager-dispatcher.service' '/etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service'
ln -s '/usr/lib/systemd/system/NetworkManager-dispatcher.service' '/etc/systemd/system/multi-user.target.wants/NetworkManager-dispatcher.service'

--- Additional comment from Berend De Schouwer on 2013-06-24 08:14:07 CDT ---

Probable root cause: /usr/lib/systemd/system-preset/90-default.preset contains
'enable nm_dispatcher.service' but not 'enable NetworkManager-dispatcher.service'

Comment 1 Dan Williams 2013-06-25 20:26:20 UTC
TLDR: it's NetworkManager-dispatcher.service, not nm_dispatcher.service.  I suppose it could use a round of cleanups to harmonize the names and the dbus service and everything else but it's likely to change in the future anyway.

Comment 2 Bill Nottingham 2013-06-25 21:24:25 UTC
This is bug 977433, isn't it?

Comment 3 Michal Schmidt 2013-06-26 08:05:01 UTC

*** This bug has been marked as a duplicate of bug 977433 ***


Note You need to log in before you can comment on or make changes to this bug.