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: do not delete system account #598

Merged
merged 3 commits into from Nov 17, 2023
Merged

Conversation

kenhys
Copy link
Contributor

@kenhys kenhys commented Nov 7, 2023

In the previous versions (5.0.0, 5.0.1), when fluent-package was
removed, system account (user and group are intended to be removed)

But there is a case that it fails to remove fluentd group because of
compatible GID is assigned for td-agent and fluentd when
fluent-package was introduced with upgrading from td-agent v4.

Removing fluentd user...
userdel: group fluentd is the primary group of another user and is not removed.
Removing fluentd group...
groupdel: cannot remove the primary group of user 'td-agent'
Removing td-agent user...
userdel: td-agent mail spool (/var/spool/mail/td-agent) not found
userdel: td-agent home directory (/var/lib/td-agent) not found

This is a bug of fluent-package apparently.

This kind of inconsistency causes maintainer script error when
reinstalling td-agent or fluent-package again.

And moreover, if system account (user and group) was removed
completely, there is a case that no user can access generated logs
when user re-installed td-agent or fluent-package. (mismatch of
UID/GID which is newly created)

This case also should be considered.
(Keep system account after removing package)

@kenhys kenhys added this to the 5.0.2 (T.B.D) milestone Nov 7, 2023
@daipom daipom self-requested a review November 16, 2023 08:49
kenhys and others added 3 commits November 17, 2023 18:04
In the previous versions (5.0.0, 5.0.1), when fluent-package was
removed, system account (user and group are intended to be removed)

But there is a case that it fails to remove fluentd group because of
compatible GID is assigned for td-agent and fluentd when
fluent-package was introduced with upgrading from td-agent v4.

  Removing fluentd user...
  userdel: group fluentd is the primary group of another user and is not removed.
  Removing fluentd group...
  groupdel: cannot remove the primary group of user 'td-agent'
  Removing td-agent user...
  userdel: td-agent mail spool (/var/spool/mail/td-agent) not found
  userdel: td-agent home directory (/var/lib/td-agent) not found

This is a bug of fluent-package apparently.

This kind of inconsistency causes maintainer script error when
reinstalling td-agent or fluent-package again.

And moreover, if system account (user and group) was removed
completely, there is a case that no user can access generated logs
when user re-installed td-agent or fluent-package. (mismatch of
UID/GID which is newly created)

This case also should be considered.
(Keep system account after removing package)

Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
…l) fix.

Co-authored-by: Daijiro Fukuda <fukuda@clear-code.com>
Signed-off-by: Kentaro Hayashi <hayashi@clear-code.com>
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!

@daipom daipom merged commit 8604678 into fluent:master Nov 17, 2023
12 checks passed
@kenhys kenhys deleted the keep-system-account branch November 17, 2023 09:11
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.

rpm: User is removed at uninstalling, which can cause error at reinstalling
2 participants