fluent-bit icon indicating copy to clipboard operation
fluent-bit copied to clipboard

build: Make systemd init systemd detection contingent on pkgconfig

Open ptsneves opened this issue 3 years ago • 5 comments

Use pkg-config to get systemd.pc variables and systemdunitdir. Those variable ensure that .service files are installed in the correct paths and only when systemd is detected.

This addresses issues where systemd unit files are in /usr/lib and not in /lib like it was previously hardcoded. It also only installs service files on actual systemd systems.


Enter [N/A] in the box, if an item is not applicable to your change.

Testing Before we can approve your change; please submit the following in a comment:

  • [ N/A ] Example configuration file for the change
  • [ N/A ] Debug log output from testing the change
  • [ N/A ] Attached Valgrind output that shows no leaks or memory corruption was found

If this is a change to packaging of containers or native binaries then please confirm it works for all targets.

  • [ N/A ] Attached local packaging test output showing all targets (including any new ones) build.

Documentation

  • [ N/A ] Documentation required for this feature

Backporting

  • [ N/A ] Backport to latest stable release.

Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.

ptsneves avatar Aug 02 '22 08:08 ptsneves

@ptsneves this looks reasonable to me so appreciate the effort - can you clarify the failing targets as well if only so people can find it in a search?

You'll need to resolve the DCO check failure: https://github.com/fluent/fluent-bit/pull/5818/checks?check_run_id=7627187832 Essentially make sure your commit has the Signed-off-by: bit in it.

We may need to wait for @niedbalski to return from holiday to sign off and merge this I'm afraid so please be patient.

patrick-stephens avatar Aug 08 '22 10:08 patrick-stephens

@niedbalski do you have time to have a look? I fixed the dco issue.

ptsneves avatar Aug 11 '22 15:08 ptsneves

@patrick-stephens Can you clarify what you mean by failing targets? :)

ptsneves avatar Aug 12 '22 22:08 ptsneves

@patrick-stephens Can you clarify what you mean by failing targets? :)

Yeah, so when would someone see this failure? On a specific target OS and/or configuration? Mostly so when someone gets the error message they get a search result from here.

patrick-stephens avatar Aug 16 '22 07:08 patrick-stephens

@patrick-stephens Thanks for the clarification.

This patch is useful when Linux systems do not have systemd installed on /lib/systemd but instead in /usr/lib/systemd. Examples are CentOS or RHEL where systemd is installed in /usr/lib/systemd. In those targets the installation would not succeed.

In the embedded world the /lib vs /usr/lib is also a configurable parameter so it cannot be assumed to be /lib/systemd like it currently is, before this patch.

ptsneves avatar Aug 17 '22 11:08 ptsneves

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

github-actions[bot] avatar Dec 07 '22 02:12 github-actions[bot]

@niedbalski can you have a look?

patrick-stephens avatar Dec 07 '22 12:12 patrick-stephens

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

github-actions[bot] avatar Mar 08 '23 02:03 github-actions[bot]