Do not require systemd to have a service file if using it for activation
authorSimon McVittie <smcv@debian.org>
Fri, 27 Nov 2015 11:31:03 +0000 (11:31 +0000)
committerSimon McVittie <smcv@debian.org>
Wed, 2 Dec 2015 18:51:08 +0000 (18:51 +0000)
commit31eccce8015c0df4b677fdb61cca4d23695c8889
tree1e95e296d5d04ad25201d5dc9750d887ca1116e7
parent5a3e7de9d631d5de0700c3144f34aecee5cf222c
Do not require systemd to have a service file if using it for activation

With --systemd-activation we special-case the name
org.freedesktop.systemd1 by assuming that it will eventually connect
to the bus. With that in mind, we can ignore whether it has a
.service file, and let it be "activated" regardless.

This fixes a regression test failure on non-systemd systems such
as the Ubuntu 14.04 OS on travis-ci.org: UpdateActivationEnvironment
failed, because it tried to update the (fake) systemd environment,
but because systemd was not actually installed, there was no
service file for it in the system's search paths. We could address this
by placing a dummy service file with Exec=/bin/false in our search path
like the real systemd does, but it seems cleaner to not require this;
this would eventually enable the real systemd to stop installing
that dummy service file.

This would not happen outside the regression tests, because there is
no sense in using --systemd-activation without systemd installed.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=93194
Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de>
bus/activation.c