Skip to content

Conversation

@cosmo0920
Copy link
Contributor

@cosmo0920 cosmo0920 commented Nov 7, 2025

The default value of workdir when running as WIndows Service is C:\Windows\System32.
However, the installed position of Fluent Bit should be differed.
By default, it'll be C:\Program Files\fluent-bit.
So, we need to refer it with --workdir option on a Windows installer of Fluent Bit.

After applying this change, the property of Fluent Bit on Windows service will be handled with the following added parameter:

スクリーンショット 2025-11-07 142906

Closes #11116.


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:

  • Example configuration file for the change
  • Debug log output from testing the change
  • 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.

  • Run local packaging test showing all targets (including any new ones) build.
  • Set ok-package-test label to test for all targets (requires maintainer to do).

Documentation

  • Documentation required for this feature

Backporting

  • 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.

Summary by CodeRabbit

  • Bug Fixes
    • Improved Windows service installation by configuring the working directory for Fluent Bit service startup on Windows systems.

…vice

Signed-off-by: Hiroshi Hatake <hiroshi@chronosphere.io>
@coderabbitai
Copy link

coderabbitai bot commented Nov 7, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

The Wix installer template for Fluent Bit's Windows service creation was updated to include a working directory parameter. The sc.exe create command now specifies --workdir "[INSTALL_ROOT]conf" in the CustomAction SetCreateFluentBitWinSvcCommand to define the service's working directory.

Changes

Cohort / File(s) Summary
Windows Service Configuration
cpack/wix/WIX.template.in.cmakein
Added --workdir "[INSTALL_ROOT]conf" parameter to the CustomAction SetCreateFluentBitWinSvcCommand that invokes sc.exe for Windows service creation

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5–10 minutes

  • Review the working directory path to ensure it references the correct installation directory
  • Verify that the conf directory exists at that location post-installation
  • Confirm the parameter syntax is compatible with the Fluent Bit service wrapper

Poem

🐰 A workdir path so fine and true,
The rabbit hops through config anew,
Windows services now know their place,
With conf in sight, they'll run with grace! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding a workdir option for Windows service registration in the build system.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cosmo0920-setup-workdir-as-install-root

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@patrick-stephens patrick-stephens merged commit 7970be4 into master Nov 7, 2025
44 checks passed
@patrick-stephens patrick-stephens deleted the cosmo0920-setup-workdir-as-install-root branch November 7, 2025 10:13
@cosmo0920 cosmo0920 added this to the Fluent Bit v4.2 milestone Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fluent-bit command to create a Windows service does not configure a "correct" working directory.

3 participants