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)
committerRalf Habacker <ralf.habacker@freenet.de>
Tue, 1 Dec 2015 23:53:00 +0000 (00:53 +0100)
commit3c602d6dfb3fb48cd1654af6b2b57f6e6b39113f
treedc22286fc23fc1f99117fb70ed1241183339018d
parent1b1d251f174728c346395c915eeac4244cbdbb84
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