Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guard launching duplicated fluentd with same configuration #4399

Closed
wants to merge 1 commit into from

Conversation

kenhys
Copy link
Contributor

@kenhys kenhys commented Feb 9, 2024

Which issue(s) this PR fixes:

Fixes fluent/fluent-package-builder#611

What this PR does / why we need it:

This is just a PoC PR.

Before:

If you launch multiple Fluentd instance with same
configuration file, it causes a disaster with inconsistency
processed buffer or pos file.

After:

Detect fluentd service's main process and fetch FLUENT_CONF.
if configuration is same as spawned process, abort it.

It can block the following conditions are met:

  • fluentd is launched via systemd (fluent-package) configuration file is specified via FLUENT_CONF.
  • manually try to launch fluentd with same configuration file as fluentd user with -c option.

Thus running fluentd service and manually try to launch normal
user case can't be detected.

NOTE: Windows is out of scope in this PR.

Docs Changes:

N/A

Release Note:

N/A

Before:

  If you launch multiple Fluentd instance with same
  configuration file, it causes a disaster with inconsistency
  processed buffer or pos file.

After:

  Detect fluentd service's main process and fetch FLUENT_CONF.
  if configuration is same as spawned process, abort it.

  It can block the following conditions are met:

  * fluentd is launched via systemd (fluent-package)
    configuration file is specified via FLUENT_CONF.
  * manually try to launch fluentd  with same configuration file as
    fluentd user with -c option.

  Thus running fluentd service and manually try to launch normal
  user case can't be detected.

NOTE: Windows is out of scope in this PR.

Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
@kenhys
Copy link
Contributor Author

kenhys commented Feb 15, 2024

Reconsider, it is not appropriate to introduce package specific fix to fluentd internals. 🤔

@kenhys kenhys closed this Feb 15, 2024
@kenhys kenhys deleted the guard-duplicated branch August 6, 2024 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prevent accidental duplicate launching
1 participant