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

deb:rpm: stop editing settings for migration #546

Merged

Conversation

daipom
Copy link
Contributor

@daipom daipom commented Jul 26, 2023

This fix stops editing /etc/default/fluentd or /etc/sysconfig/fluentd for migration.
We shouldn't touch the settings for migration.

For migration of the config file, we make a symlink:

  • /etc/fluent/fluent.conf => /etc/fluent/td-agent.conf

We stop migrating the log filename.
If need to output logs to the old filename td-agent.log, user needs to set the environmental variable.

@daipom
Copy link
Contributor Author

daipom commented Jul 26, 2023

This PR is originally motivated by the idea that the main migration target should be existing user service files and we should not do complicated migration processes for our own assumption.

In this case, users should migrate the user service file manually. Since we provide symlinks /etc/td-agent/ and /var/log/td-agent/, updating some paths should work:

* `LD_PRELOAD`

* `GEM_HOME`

* `GEM_PATH`

* `/opt/td-agent/bin/fluentd`

I assume the following script, for example.

sudo sed -i /etc/systemd/system/td-agent.service -e 's /opt/td-agent/lib/libjemalloc.so /opt/fluent/lib/libjemalloc.so g'
sudo sed -i /etc/systemd/system/td-agent.service -e 's /opt/td-agent/lib/ruby/gems/2.7.0/ /opt/fluent/lib/ruby/gems/3.2.0/ g'
sudo sed -i /etc/systemd/system/td-agent.service -e 's /opt/td-agent/lib/ruby/gems/2.7.0/ /opt/fluent/lib/ruby/gems/3.2.0/ g'
sudo sed -i /etc/systemd/system/td-agent.service -e 's /opt/td-agent/bin/fluentd /opt/fluent/bin/fluentd g'
echo "Alias=fluentd.service" | sudo tee -a /etc/systemd/system/td-agent.service

This should be done by users manually, I think.

@daipom
Copy link
Contributor Author

daipom commented Jul 26, 2023

Recently, ServerSpec test for RockyLinux8 often fails and we can't confirm the results of systemd tests.
To check the results, I ran the tests without ServerSpec test on my fork.
The tests for yum are stable.

@daipom daipom force-pushed the deb-rpm-stop-editing-setting-for-migration branch 2 times, most recently from af4331c to 95a8559 Compare July 26, 2023 07:28
@kenhys
Copy link
Contributor

kenhys commented Jul 26, 2023

By the way, how about testing with /etc/systemd/system/td-agent.d/override.conf?

@daipom daipom force-pushed the deb-rpm-stop-editing-setting-for-migration branch 2 times, most recently from aa854f3 to 15794af Compare July 26, 2023 09:02
The old service file should work as before.
So, we shouldn't touch the current settings by our own
assumptions.

Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
@daipom
Copy link
Contributor Author

daipom commented Jul 27, 2023

By the way, how about testing with /etc/systemd/system/td-agent.d/override.conf?

Thanks. I will separate the fixes about user service file tests from this PR.
I will consider it later!

Signed-off-by: Daijiro Fukuda <fukuda@clear-code.com>
@daipom
Copy link
Contributor Author

daipom commented Jul 27, 2023

yum tests are all green in my fork(without serverspec test): https://github.com/daipom/fluent-package-builder/actions/runs/5666906256

The Jammy test fails because some gem paths of v450 are different from other platform.
It is just a problem of tests.
I will separate these new tests from this PR since it is not directly related to this PR.

@daipom daipom force-pushed the deb-rpm-stop-editing-setting-for-migration branch from 15794af to ee68fcb Compare July 27, 2023 04:21
@daipom
Copy link
Contributor Author

daipom commented Jul 27, 2023

I will separate the fixes about user service file tests from this PR.

Done.

Copy link
Contributor

@kenhys kenhys left a comment

Choose a reason for hiding this comment

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

LGTM.

@kenhys kenhys merged commit 30939fc into fluent:master Jul 27, 2023
9 of 11 checks passed
@daipom daipom deleted the deb-rpm-stop-editing-setting-for-migration branch July 27, 2023 04:26
@daipom
Copy link
Contributor Author

daipom commented Jul 27, 2023

Thanks for your review!

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.

2 participants