Skip to content

postinst hook ignores policy-rc.d on Debian-alikes #9551

Open
@DWSR

Description

@DWSR

Output of the info page (if this is a bug)
N/A

Describe what happened:

  • I updated /usr/sbin/policy-rc.d to exit with code 101 always, which should cause services installed via APT to not start automatically.
  • I installed the datadog-agent package via APT.
  • The datadog-agent service was automatically enabled and started, but crashed because configuration was incomplete.

Describe what you expected:
I expected the datadog-agent package to honour policy-rc.d and not start the service

The postinst hook should use deb-systemd-invoke and debian-systemd-helper from init-system-helpers, rather than invoking systemctl directly:

https://manpages.debian.org/testing/init-system-helpers/deb-systemd-helper.1p.en.html
https://manpages.ubuntu.com/manpages/focal/man1/deb-systemd-invoke.1p.html

Steps to reproduce the issue:
See above.

Additional environment details (Operating System, Cloud provider, etc):
Ubuntu 20.04 LTS, but this should be reproducible on any Debian-alike.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions