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

rpm: take over enabled state of systemd service from v4 #613

Merged
merged 4 commits into from
Feb 19, 2024

Conversation

kenhys
Copy link
Contributor

@kenhys kenhys commented Feb 5, 2024

In the previous versions, the enabled service status of td-agent was not migrated.

This commit try to take over existing td-agent service status.

Note that if systemctl enable fluentd is executed in %post section, it was reverted in td-agent's %preun scriptlet.
So it is enabled in %posttrans explicitly.

Closes: #610

@kenhys
Copy link
Contributor Author

kenhys commented Feb 5, 2024

enable state will be kept like this:

  Running scriptlet: td-agent-4.5.2-1.el8.x86_64                                                                                        2/2 
  Running scriptlet: fluent-package-5.0.2-2.el8.x86_64                                                                                  2/2 
Provides /usr/sbin/td-agent symlink for backward compatibility
Provides /usr/sbin/td-agent-gem symlink for backward compatibility
Provides /etc/td-agent symlink for backward compatibility
Provides /var/log/td-agent symlink for backward compatibility
td-agent was enabled. Take over enabled service status ...
Created symlink /etc/systemd/system/td-agent.service → /usr/lib/systemd/system/fluentd.service.
Created symlink /etc/systemd/system/multi-user.target.wants/fluentd.service → /usr/lib/systemd/system/fluentd.service.

  Running scriptlet: td-agent-4.5.2-1.el8.x86_64                                                                                        2/2 
  Verifying        : fluent-package-5.0.2-2.el8.x86_64                                                                                  1/2 
  Verifying        : td-agent-4.5.2-1.el8.x86_64                                                                                        2/2 

Installed:
  fluent-package-5.0.2-2.el8.x86_64                                                                                                         

Complete!
[vagrant@almalinux8 ~]$ sudo systemctl is-enabled fluentd
enabled

@kenhys
Copy link
Contributor Author

kenhys commented Feb 5, 2024

#614 should be fixed in advance.

@kenhys kenhys marked this pull request as draft February 7, 2024 05:32
@kenhys kenhys force-pushed the keep-systemctl-enabled branch from 5df1875 to caca57b Compare February 7, 2024 07:55
In the previous versions, the enabled service status of td-agent
was not migrated.

This commit try to take over existing td-agent service status.

Note that if systemctl enable fluentd is executed in %post section,
it was reverted in td-agent's %preun scriptlet.
So it is enabled in %posttrans explicitly.

Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
@kenhys kenhys force-pushed the keep-systemctl-enabled branch from caca57b to a172178 Compare February 7, 2024 08:26
@kenhys kenhys marked this pull request as ready for review February 7, 2024 09:04
@kenhys kenhys requested a review from daipom February 7, 2024 09:49
@kenhys kenhys added this to the 5.0.3 milestone Feb 13, 2024
Copy link
Contributor

@daipom daipom left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

I have commented about some test codes.
Now, these enable are just to enable the alias.
(When taking over the enabled status.)

kenhys and others added 3 commits February 19, 2024 13:58
Co-authored-by: Daijiro Fukuda <fukuda@clear-code.com>
Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
…ckward-compat-for-v4.sh

Co-authored-by: Daijiro Fukuda <fukuda@clear-code.com>
Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
Co-authored-by: Daijiro Fukuda <fukuda@clear-code.com>
Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
@kenhys kenhys force-pushed the keep-systemctl-enabled branch from 30e4e96 to 4fffa1c Compare February 19, 2024 04:59
@kenhys
Copy link
Contributor Author

kenhys commented Feb 19, 2024

NOTE: https://chocolatey.org/ is under maintenance.

so https://chocolatey.org/install.ps1 is not accessible for a while. (windows CI fails)

@kenhys kenhys merged commit eada0a7 into fluent:master Feb 19, 2024
21 of 22 checks passed
@kenhys kenhys deleted the keep-systemctl-enabled branch February 19, 2024 05:50
@daipom
Copy link
Contributor

daipom commented Feb 19, 2024

Thanks!

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.

Enabled state of systemd service isn't migrated on upgrading from td-agent v4 to fluent-package v5
2 participants