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
- 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).
- adding "requires: initscripts" to the osquery RPM specs (
CPACK_RPM_PACKAGE_REQUIRES)
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
initscriptsandchkconfigneed 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
CPACK_RPM_PACKAGE_REQUIRES)