Bug 948433 - Please add systemd unit file for nm_dispatcher
Summary: Please add systemd unit file for nm_dispatcher
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: NetworkManager
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Dan Williams
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 978026
TreeView+ depends on / blocked
 
Reported: 2013-04-04 17:33 UTC by Lennart Poettering
Modified: 2015-02-18 11:10 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 978026 (view as bug list)
Environment:
Last Closed: 2015-02-18 11:10:55 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Lennart Poettering 2013-04-04 17:33:51 UTC
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

Comment 1 Dan Williams 2013-05-15 12:27:42 UTC
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?

Comment 2 Dan Williams 2013-05-15 15:32:49 UTC
Built for F20; F19 will follow soon. NetworkManager-0.9.9.0-2.git20130515.fc20

Comment 3 Fedora Update System 2013-06-07 22:28:38 UTC
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

Comment 4 Fedora Update System 2013-06-09 03:28:18 UTC
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.

Comment 5 Berend De Schouwer 2013-06-11 07:43:02 UTC
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.

Comment 6 Berend De Schouwer 2013-06-24 13:08:40 UTC
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'

Comment 7 Berend De Schouwer 2013-06-24 13:14:07 UTC
Probable root cause: /usr/lib/systemd/system-preset/90-default.preset contains
'enable nm_dispatcher.service' but not 'enable NetworkManager-dispatcher.service'

Comment 8 Dan Williams 2013-06-25 20:24:32 UTC
(In reply to Berend De Schouwer from comment #7)
> Probable root cause: /usr/lib/systemd/system-preset/90-default.preset
> contains
> 'enable nm_dispatcher.service' but not 'enable
> NetworkManager-dispatcher.service'

I filed https://bugzilla.redhat.com/show_bug.cgi?id=978026 for that against systemd, where those presets live.

Comment 9 Michael Biebl 2013-06-25 20:42:55 UTC
(In reply to Lennart Poettering from comment #0)
> [Install]
> WantedBy=multi-user.target
> Alias=dbus-org.freedesktop.nm-dispatcher.service
> </snip>

Hi Lennart, is there a solid reason why the dispatcher service should be enabled via multi-user.target. It's a short-lived process which is triggered on-demand and exits itself after a short time.
This means, we will most likely spawn a useless process during boot.

So, I think the WantedBy= should be dropped.
Or at the very least, it should be bound to NetworkManager.service.
Enabling this service on its own doesn't really make sense.

An Also=NetworkManager-dispatcher.service in NetworkManager.service would make sense, too.
If one disables NetworkManager.service, there is no point keeping the dispatcher service active.
This also means, you don't need explicit enable/disable calls.

Comment 10 Lennart Poettering 2013-06-26 15:01:15 UTC
Oh, I wasn't aware it is short-lived only. In that case, drop the multi-user.target bit, and just make it create the dbus alias.

[Install]
Alias=dbus-org.freedesktop.nm-dispatcher.service

And yeah, adding Also=NetworkManager-dispatcher.service to NetworkManager.service certainly would be a good idea.

Comment 11 Dan Williams 2013-08-06 21:19:50 UTC
Ok, so we'll add Also= to NM, but this isn't going to help people that already installed the update, or is it?

Comment 12 Dmitry Torokhov 2013-08-15 15:47:34 UTC
This just broke F18 - if you rely on new services please do not forget to enable them in upgrade scripts as not everyone does fresh install.

Comment 13 Dan Winship 2013-08-28 18:34:33 UTC
(In reply to Dan Williams from comment #11)
> Ok, so we'll add Also= to NM, but this isn't going to help people that
> already installed the update, or is it?

The "Also=" happened, and I think the rest is bug 974811?

Comment 14 Fedora End Of Life 2015-01-09 22:33:06 UTC
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 15 Fedora End Of Life 2015-02-18 11:10:55 UTC
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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