Bug 71818 - do not install systemd unit files if systemd disabled
Summary: do not install systemd unit files if systemd disabled
Status: RESOLVED FIXED
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: 1.5
Hardware: Other All
: medium normal
Assignee: Simon McVittie
QA Contact:
URL:
Whiteboard: review+
Keywords: patch
Depends on:
Blocks:
 
Reported: 2013-11-20 03:30 UTC by Chengwei Yang
Modified: 2014-02-19 18:15 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
[PATCH] Do not install systemd unit files if build without systemd (1.21 KB, patch)
2013-11-20 03:33 UTC, Chengwei Yang
Details | Splinter Review
Only support systemd: transport if we have systemd libraries (29.87 KB, patch)
2014-01-06 18:15 UTC, Simon McVittie
Details | Splinter Review

Description Chengwei Yang 2013-11-20 03:30:37 UTC
I found that 'make install' will install dbus systemd unit files regardless if configured with '--disable-systemd'.

I think this is a bug. If compiled without systemd, the units shouldn't be installed.
Comment 1 Chengwei Yang 2013-11-20 03:33:28 UTC
Created attachment 89506 [details] [review]
[PATCH] Do not install systemd unit files if build without systemd
Comment 2 Simon McVittie 2013-11-27 15:02:12 UTC
The help text for --enable-systemd actually still says

AC_ARG_ENABLE(systemd, AS_HELP_STRING([--enable-systemd],[build with systemd at_console support]),enable_systemd=$enableval,enable_systemd=auto)

which is clearly not the whole story any more... but does make the point that our "systemd support" has several parts.

Our systemd activation support is actually unconditional at compile time (although it can only be enabled at runtime on Unix platforms), and the systemd: transport is only conditional on DBUS_UNIX (although it's just a stub unless __linux__ is also defined). Those are the only bits that the systemd unit actually needs.

--enable-systemd does improve systemd-logind and systemd-journald integration, but it isn't mandatory even on systemd systems, as far as I can see - we use it to support at_console via logind, and to support Journal-based logging, both of which are nice-to-have but clearly optional.

Orthogonally, it's possible to avoid installing the units even if building on a systemd system, via --with-systemdsystemunitdir=no, or equivalently, --without-systemdsystemunitdir.

I can see two routes that make sense:

* Make systemd support monolithic and "all or nothing": use the systemd
  shared library instead of sd-daemon.c, and don't compile anything
  systemd-related unless systemd shared libraries are found.

* Have as much systemd support as possible, even if systemd libraries
  are missing or explicitly disabled.

The former would let us drop sd-daemon.[ch], since at that point we'd be relying on its shared libraries anyway.

The latter gives you a maximally functional "bootstrap" build of dbus (enough to be usable in most production scenarios, even) when using it to break the systemd <-> dbus dependency cycle, on systemd versions that don't yet contain a complete reimplementation of libdbus (which AIUI means every released version, but not the next release?).

Lennart, any opinion on which way we should go?
Comment 3 Lennart Poettering 2013-12-11 00:59:53 UTC
I'd keep it simple and just turn on everything or turn off everything and that's it.
Comment 4 Simon McVittie 2014-01-06 16:43:53 UTC
(In reply to comment #3)
> I'd keep it simple and just turn on everything or turn off everything and
> that's it.

Fair enough. Merged Attachment #89506 [details] for 1.7.10, but I'll leave this open until I've made --[en|dis]able-systemd a bit more all-or-nothing.
Comment 5 Simon McVittie 2014-01-06 18:15:28 UTC
Created attachment 91548 [details] [review]
Only support systemd: transport if we have systemd  libraries

This means we can drop our convenience copy of sd-daemon.[ch]. We're
checking for libsd-daemon anyway, to support journald and logind
integration.
Comment 6 Lennart Poettering 2014-01-16 17:39:56 UTC
(In reply to comment #5)
> Created attachment 91548 [details] [review] [review]
> Only support systemd: transport if we have systemd  libraries
> 
> This means we can drop our convenience copy of sd-daemon.[ch]. We're
> checking for libsd-daemon anyway, to support journald and logind
> integration.

Looks good!
Comment 7 Simon McVittie 2014-01-17 16:01:15 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > Only support systemd: transport if we have systemd  libraries
> 
> Looks good!

Thanks. Adding a new dependency for 1.8.0 when I've already done 1.8rc1 seems undesirable, so I'll apply this when I branch for 1.9.
Comment 8 Simon McVittie 2014-02-19 18:15:20 UTC
1.9.0


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.