Detection of systemd breaks building in docker

Bug #1918209 reported by Bryce Harrington on 2021-03-09
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apache2 (Ubuntu)
High
Bryce Harrington

Bug Description

apache2ctl detects if systemd is in use by looking at the owner of /proc/1/exe.

Under docker, however, this cannot be relied on and may simply be the command being run:

  $ docker run --rm --name "apache2-test" 26ff08910bcd ls -l /proc/1/exe
  lrwxrwxrwx 1 root root 0 Feb 23 22:07 /proc/1/exe -> /usr/bin/ls

This is seen as causing OCI build failures, with an error such as:

...
Enabling site 000-default.
update-rc.d: error: no runlevel symlinks to modify, aborting!
dpkg: error processing package apache2 (--configure):
 installed apache2 package post-installation script subprocess returned error exit status 1
Processing triggers for libc-bin (2.33-0ubuntu2) ...
Errors were encountered while processing:
 apache2
...

[Proposed Fix]
Another way to look for systemd is [ -d /run/systemd/system ], which may be worth having as a fallback to check if /proc/1 is not systemd.

Related branches

Bryce Harrington (bryce) on 2021-03-09
description: updated
Changed in apache2 (Ubuntu):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Bryce Harrington (bryce)
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apache2 - 2.4.46-4ubuntu1

---------------
apache2 (2.4.46-4ubuntu1) hirsute; urgency=medium

  * Merge with Debian unstable, to allow moving from lua5.2 to
    lua5.3 (LP: #1910372). Remaining changes:
    - debian/{control, apache2.install, apache2-utils.ufw.profile,
      apache2.dirs}: Add ufw profiles.
    - debian/apache2.py, debian/apache2-bin.install: Add apport hook.
    - d/index.html, d/icons/ubuntu-logo.png, d/apache2.postrm: replace
      Debian with Ubuntu on default page.
      + d/source/include-binaries: add Ubuntu icon file
    - d/t/control, d/t/check-http2: add basic test for http2 support
    - d/p/t/apache/expr_string.t: Avoid test suite failure due to timing
      issue reading error log too quickly after request, by adding a sleep.
      (LP #1890302)
    - d/apache2ctl: Also use systemd for graceful if it is in use.
      This extends an earlier fix for the start command to behave
      similarly for restart / graceful. Fixes service failures on
      unattended upgrade.
  * Drop:
    - d/perl-framework/t/modules/allowmethods.t: disable reset test. This
      was re-added by mistake in 2.4.41-1 (Closes #921024)
      [Included in Debian 2.4.46-3]
  * d/apache2ctl: Also use /run/systemd to check for systemd usage
    (LP: #1918209)

 -- Bryce Harrington <email address hidden> Tue, 09 Mar 2021 00:45:35 +0000

Changed in apache2 (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers