Bug 269480 - sysutils/fluent-bit: rc.d script should not use --daemon option when combined with daemon command
Summary: sysutils/fluent-bit: rc.d script should not use --daemon option when combined...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Palle Girgensohn
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-10 23:45 UTC by Hiroo Ono
Modified: 2024-11-05 13:06 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (girgen)


Attachments
patch to fluent-bit.in (1010 bytes, patch)
2023-02-10 23:45 UTC, Hiroo Ono
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hiroo Ono 2023-02-10 23:45:21 UTC
Created attachment 240071 [details]
patch to fluent-bit.in

The option --daemon is passed to fluent-bit in the rc.d script. This makes the pid of fluent-bit not matching with the one written if /var/run/fluent-bit.pid.
The file /var/run/fluent-bit.pid is written by daemon command, where the value is the pid of the child process which executes fluent-bit. If you pass --daemon option, fluent-bit itself forks and executes again and the pid becomes different  from the pid written in the pid file.
Try 'service fluent-bit start' and see the value of 'pgrep fluent-bit' and 'cat /var/run/fluent-bit.pid'.
This makes 'service fluent-bit stop' and 'service fluent-bit status' not working. Also, the daemon command daemonize a program running foreground, so there is no need to set --daemon option to fluent-bit.
Comment 1 commit-hook freebsd_committer freebsd_triage 2024-11-05 13:02:43 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=923cb3477f58fcd1dd44eb4e682fef130c271eee

commit 923cb3477f58fcd1dd44eb4e682fef130c271eee
Author:     Palle Girgensohn <girgen@FreeBSD.org>
AuthorDate: 2024-11-05 11:04:55 +0000
Commit:     Palle Girgensohn <girgen@FreeBSD.org>
CommitDate: 2024-11-05 13:02:14 +0000

    sysutils/fluent-bit: Update to 3.1.10

    Make postgresql and lua default on, since the documentation for
    fluent-bit has no mention of them possibly ever being off.

    Fix start script to not use --daemon option redundantly when we already
    use the daemon(8) tool.

    PR:     281459, 269480

    Release notes:  https://github.com/fluent/fluent-bit/releases/tag/v3.1.10

 sysutils/fluent-bit/Makefile            | 4 ++--
 sysutils/fluent-bit/distinfo            | 6 +++---
 sysutils/fluent-bit/files/fluent-bit.in | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
Comment 2 Palle Girgensohn freebsd_committer freebsd_triage 2024-11-05 13:03:23 UTC
Committed. Thanks!
Comment 3 Mateusz Piotrowski freebsd_committer freebsd_triage 2024-11-05 13:06:26 UTC
Thank you!