Skip to content

Commit

Permalink
Backport(v1.16) command: fix NoMethodError of --daemon under Windows (#…
Browse files Browse the repository at this point in the history
…4796)

**Which issue(s) this PR fixes**: 

Backport #4716 

**What this PR does / why we need it**: 
To daemonize the process, the following code will be invoked on Windows:

https://github.com/fluent/fluentd/blob/89f0a76fb2e050659f0a503823beb2ad8cf899eb/lib/fluent/daemon.rb#L13

$log variable does not exist because it has not executed
`Superviser#setup_global_logger` method until here.
It will perform a new startup process and prepare a logger in

https://github.com/fluent/fluentd/blob/89f0a76fb2e050659f0a503823beb2ad8cf899eb/lib/fluent/daemon.rb#L13

This patch will only avoid the error since a logger is not required this
process.

**Docs Changes**:
Not needed.

**Release Note**: 
The same as the title.

Signed-off-by: Shizuo Fujita <[email protected]>
Signed-off-by: Kentaro Hayashi <[email protected]>
Co-authored-by: Watson <[email protected]>
  • Loading branch information
kenhys and Watson1978 authored Jan 29, 2025
1 parent fbdc5a6 commit fc5ece8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/fluent/supervisor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ def self.serverengine_config(params = {})
stop_immediately_at_unrecoverable_exit: true,
root_dir: params['root_dir'],
logger: $log,
log: $log.out,
log: $log&.out,
log_level: params['log_level'],
chuser: params['chuser'],
chgroup: params['chgroup'],
Expand Down

0 comments on commit fc5ece8

Please sign in to comment.