Bug 101706

Summary: Remove distro-specific init scripts
Product: dbus Reporter: Simon McVittie <smcv>
Component: coreAssignee: Simon McVittie <smcv>
Status: RESOLVED FIXED QA Contact: D-Bus Maintainers <dbus>
Severity: normal    
Priority: medium CC: amigadave, yselkowi
Version: git masterKeywords: patch
Hardware: Other   
OS: All   
Whiteboard: review+
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 101964    
Attachments: Remove distribution-specific init-scripts

Description Simon McVittie 2017-07-06 11:17:12 UTC
At the moment, upstream dbus contains the following ways to start the
system bus:

* A distribution-neutral systemd unit, used in anything that boots with
  systemd (Fedora, Ubuntu, default Debian installations etc.). This is
  actively maintained, and I'm not going to remove it.

* An LSB-style init script for Red Hat and related distributions
  (bus/messagebus.in). This was used in Red Hat and Fedora before they
  adopted systemd, but as far as I know is not used any more.
  I am concerned that this is unmaintained.

* An LSB-style init script for Slackware (bus/rc.messagebus.in),
  which appears to be very bare-bones and in particular has an inadvisable
  use of killall. This does not appear to be used in Slackware, which
  ships a different (patched?) implementation of rc.messagebus[0].
  I am concerned that this is unmaintained.

* Something analogous to an init script for Cygwin (bus/messagebus-config.in)
  I am concerned that this is potentially unmaintained.

None of the init scripts have changed since 2010, and it isn't clear to me
whether they are maintained or actively used. Linux distributions that boot
with sysvinit (older or non-default Debian installations, Devuan, etc.)
typically provide their own LSB init script instead of using the ones
we provide upstream (for example [1] in Debian/Devuan), which means the
ones we provide upstream are not tested and therefore probably don't
actually work. I would like to remove anything that is not actively
supported by contributions to the upstream project, to avoid giving a
false impression of quality or support.

I propose that in the dbus 1.11.x development branch leading to
the dbus-1.12 stable release, we remove the Red Hat init script, the
Slackware init script, and the Cygwin "config". Launching dbus-daemon
from third-party init scripts using its documented command-line options
will continue to be a valid configuration (to be completely clear,
I am **not** proposing to make systemd the only supported platform),
but downstreams that use an integration layer other than via systemd
to start the system dbus-daemon will be responsible for maintaining
that integration layer themselves. In practice, it appears that they
already do.

This would have the following effects on third-party distributors:

* Linux distributions that exclusively boot with systemd would be
  unaffected, because upstream contributors (including me) actively
  maintain this configuration

* OS distributions that (exclusively or optionally) boot with LSB
  init scripts, Upstart jobs or other integration that they add downstream
  (Slackware, Debian, Devuan) would be mostly unaffected

  - However, if they use the --with-init-scripts=redhat configure argument
    for its side-effect of changing the pid file location, or if they
    rely on Red Hat being auto-detected, they will have to pass the
    --with-system-pid-file=PATH configure argument instead

* OS distributions that rely on --with-init-scripts=redhat,
  --with-init-scripts=slackware, --with-init-scripts=cygwin, or
  auto-detection of Red Hat, Slackware or Cygwin will need to take
  action to provide their own init scripts

As an alternative, I don't mind keeping bus/messagebus.in (historically
Red Hat), bus/rc.messagebus.in (Slackware) and/or bus/messagebus-config.in
(Cygwin) in the upstream dbus project, **if** some named person or group
is willing to commit to providing timely testing and patches to ensure
that they continue to be correct in the upstream development branch
(git master).

However, I suspect that in practice downstreams will find it easier
to maintain their init-scripts "out of tree", like I do for the LSB
init script provided by Debian[1]. This has the advantage that the
downstream distributor can make full use of any vendor-specific tools,
like Debian's start-stop-daemon, to make their init script better.

I'm going to announce this on the mailing list for comment.

[0] https://mirrors.slackware.com/slackware/slackware-current/source/a/dbus/rc.messagebus.gz
[1] https://anonscm.debian.org/cgit/pkg-utopia/dbus.git/tree/debian/dbus.init
Comment 1 Simon McVittie 2017-09-25 15:50:06 UTC
(In reply to Simon McVittie from comment #0)
> At the moment, upstream dbus contains the following ways to start the
> system bus:
...
> * Something analogous to an init script for Cygwin (bus/messagebus-config.in)
>   I am concerned that this is potentially unmaintained.

cc'ing its credited author.

This is the only one of the "init scripts" that seems to be still in use in its intended distribution (Red Hat derivatives use systemd now, and Slackware use their own copy of rc.messagebus instead of ours) so removing it is perhaps less clear-cut than the other two.

However, it seems to be something like 10% dbus knowledge and 90% Cygwin knowledge, and if someone reports a bug in it, the dbus maintainers are unlikely to know how to fix that bug; so it is probably better off being maintained downstream, analogous to how RPM spec files and Cygwin "ports" files are maintained by their respective downstreams.
Comment 2 Simon McVittie 2017-09-25 15:55:18 UTC
Created attachment 134466 [details] [review]
Remove distribution-specific init-scripts

LSB-style (SysV-style) init scripts have not historically been
portable between distributions, as evidenced by the presence of both
"Red Hat" and "Slackware" init scripts in dbus. Many distributors
prefer to maintain them downstream, as is done in Debian (and its
derivatives) and in Slackware, so that the init script can follow
OS conventions (for example regarding boot messages) and make use
of OS-provided facilities (for example, the Debian init script uses
dpkg's start-stop-daemon utility).

The Slackware and Red Hat init scripts removed by this commit are not
tested or maintained in practice, and so are likely to have bugs. The
Slackware init-script provided here is not used on actual Slackware
systems, which provide a different implementation of rc.messagebus in
their packaging, while the Red Hat init script has been superseded by
the systemd unit in current Fedora, CentOS and RHEL versions.

The Cgywin messagebus-config provided here does appear to be used in
production in cygwin-ports, but it's full of Cygwin-specifics with which
the dbus maintainers are not familiar, so it is probably more appropriate
for it to be tracked downstream as part of the Cygwin packaging.

The systemd unit is not removed, since it is used on multiple Linux
distributions with little or no modification, and receives regular
testing and maintenance; this makes it appropriate to maintain upstream.
Comment 3 Yaakov Selkowitz 2017-09-25 15:56:31 UTC
I have no objections in removing the Cygwin init script from the sources.
Comment 4 Philip Withnall 2017-09-25 16:12:23 UTC
Comment on attachment 134466 [details] [review]
Remove distribution-specific init-scripts

Review of attachment 134466 [details] [review]:
-----------------------------------------------------------------

Looks good to me. If it still passes distcheck, push it!
Comment 5 Simon McVittie 2017-09-25 23:36:52 UTC
Init scripts removed in 1.11.18.

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.