[systemd-devel] Socket activation and busname aliases in Network/ModemManager

Lennart Poettering lennart at poettering.net
Thu Jun 20 10:56:11 PDT 2013


On Thu, 20.06.13 09:31, Colin Guthrie (gmane at colin.guthr.ie) wrote:

> As is uses the dbus alias, I guess the intention is that it only works
> when the service is enabled in systemd. Without the service being
> enabled, the alias does not exist and thus it cannot be bus activated.

Correct.

> I guess that all makes sense although it is a little bit counter
> intuitively "belt and braces" as you cannot enable on-demand bus
> activation without enabling static activation on boot also (due to
> WantedBy= line).

That's intended actually.

"systemctl enable" is supposed to be this thing that enables a service
into all the vendor defined default hooks, i.e. into the sane hooks that
make a good default. If an admin wants to deviate from that he can do
that by placing the symlinks manually.

Now, for things like NM this means that if you enable the service you
probably want to enable it on-bus + on-boot and possibly
on-hardware. "systemctl enable" should set up all three hooks.

We shouldn't try to provide commands for everything the admin ever might
want. We should provide a good way to apply defaults, and then make it
easy to make local alterations to these defaults, for example by "rm"ing
or "ln -s"ing more .wants/ links.

> Now for NetworkManager itself this more or less OK. You'll be needing it
> pretty much immediately on boot anyway, but what's caught me out a
> little bit more is that ModemManager (0.7.991) also follows this same
> pattern.

Actually MM recently got broken. It really shouldn't do what it is doing
now.

See:

https://bugzilla.gnome.org/show_bug.cgi?id=701229#c15

(which is a bug I really would like to reopen, but for which I
apparently lack privileges.)

> For me this seems a little strange. Modems are not as common these days
> and I don't really want to have this enabled and running on my machine
> if I don't really need it. Normally I'd expect it to be bus activated if
> I go the relevant menu options via one of the NM control applets etc.
> 
> I presume that to have "bus activation by default", the only change
> needed would be to change the dbus .service file for modem manager to
> refer to the SystemdService via it's normal name and not via it's bus
> alias? Is this the "expected" way to work.

MM really should be activated on-bus (and possibly on-hardware), but not
on-boot. Hence that's what the [Install] block in the service file
should encode.

Hardcoding activation which does not involve the bus symlink is really
nasty for admins, since they need to resort to tricks like "systemctl
mask" to really get rid of such a service. "systemctl mask" however is
supposed to be this last resort tool, for gurus, hackers, developers,
and nothing that should ever be used in normal codepaths when nothing is
wrong.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list