-
Notifications
You must be signed in to change notification settings - Fork 26
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
Prevent accidental duplicate launching #611
Comments
It may be better to implement such a guard feature in fluentd not fluent-package-builder. |
https://github.com/fluent/fluentd/blob/master/lib/fluent/command/fluentd.rb#L343 |
I too think it may end up that way. |
Use case on Windows:
If fluentdopt is not changed, usually c:/opt/fluent/etc/fluent/fluentd.conf will be used in both cases.
Use case in Linux:
If fluentd.service is not changed, usually /etc/fluent/fluentd.conf (FLUENT_CONF) will be used. If configuration path is specified explicitly with -C /etc/fluent/fluentd.conf, need to /opt/fluent/bin/fluentd is autogenerated file, so lib/fluent/comman/fluentd may be better to block it. NOTE: both of cases, finally call lib/fluent/comand/fluentd (/opt/fluent/bin/fluentd => gems.../bin/fluentd => gems../lib/fluent/command/fluentd) |
PoC PR for this issue. Not stable yet because the guard condition fires unexpectedly. |
|
|
Thanks!
This? DEFAULT_CONFIG_PATH = ENV['FLUENT_CONF'] || '/etc/fluent/fluent.conf' However,
|
Yes, so fixed via #622. |
Thanks! Sorry for keeping you waiting. I will see it tomorrow or this weekend. |
Closes: fluent#611 Before: We can launch Fluentd by /usr/sbin/fluentd even though fluentd service is running. Launching multiple Fluentd with the same config may cause inconsistency of the buffers or the pos files. After: We can't launch Fluentd by /usr/sbin/fluentd with the default config path if fluentd service is running. If one of the following options is specified, we can execute fluentd as before. * --config (-c) * --dry-run Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
Closes: fluent#611 Before: We can launch Fluentd by /usr/sbin/fluentd even though fluentd service is running. Launching multiple Fluentd with the same config may cause inconsistency of the buffers or the pos files. After: We can't launch Fluentd by /usr/sbin/fluentd with the default config path if fluentd service is running. If one of the following options is specified, we can execute fluentd as before. * --config (-c) * --dry-run Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
Closes: fluent#611 Before: We can launch Fluentd by /usr/sbin/fluentd even though fluentd service is running. Launching multiple Fluentd with the same config may cause inconsistency of the buffers or the pos files. After: We can't launch Fluentd by /usr/sbin/fluentd with the default config path if fluentd service is running. If one of the following options is specified, we can execute fluentd as before. * --config (-c) * --dry-run Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
Closes: fluent#611 Before: We can launch Fluentd by /usr/sbin/fluentd even though fluentd service is running. Launching multiple Fluentd with the same config may cause inconsistency of the buffers or the pos files. After: We can't launch Fluentd by /usr/sbin/fluentd with the default config path if fluentd service is running. If one of the following options is specified, we can execute fluentd as before. * --config (-c) * --dry-run Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
fluentd
ortd-agent
command launches Fluentd with the default config path.This makes it easy to start Fluentd, but it also causes accidental duplicate launching.
For example, it launches Fluentd duplicated while Fluentd is running as a systemd unit.
Processing the same files, such as buffer files, pos files, and output destination files, causes unassumed errors.
At worst, it may cause file corruption or data loss.
The current specification makes it too easy to start Fluentd, so I'm concerned about mishandling.
For example, trying to check the version and launching Fluentd by mistake, etc.
The current specification
The default config path is set in env variables.
fluent-package-builder/fluent-package/templates/usr/sbin/fluentd.erb
Line 4 in c75754e
So, we can start Fluentd without any command arguments.
fluent-package:
$ fluentd
td-agent:
$ td-agent
What I want to do
I want to add some prevention.
For example,
It would change the specifications, so we need to be careful about compatibility.
The text was updated successfully, but these errors were encountered: