Skip to content

Linux RPM writes to init.d on systemd-only systems #27

@mike-myers-aapl

Description

@mike-myers-aapl

https://github.com/osquery/osquery-packaging/blob/master/platform/linux/rpm.cmake#L35 installs a file (an init.d script) to /etc/init.d/ to support the starting of the osqueryd service on legacy systems that use init.d. On systemd-only hosts where /etc/init.d/ does not exist, the RPM will create the directory and place the unused script there.

While this does not cause the install to fail, it is undesirable on systems that have no SysVinit compatibility layer — it leaves behind an unnecessary directory and script that serve no purpose since the systemd unit file (/usr/lib/systemd/system/osqueryd.service) is the only service definition that will be used.

Specifically, for system administrators, it creates a dependency ordering headache where the legacy packages initscripts and chkconfig need to be installed before osquery is installed, or they will fail to install because osquery's RPM has put a file in /etc/init.d/.

Approaches to fix might include

  1. deferring the choice of final destination for the file write, to the %post scriplet (allow it to be conditional at runtime, either the init.d location or the systemd location).
  2. adding "requires: initscripts" to the osquery RPM specs (CPACK_RPM_PACKAGE_REQUIRES)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions