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: User is removed at uninstalling, which can cause error at reinstalling #597

Closed
daipom opened this issue Nov 2, 2023 · 0 comments · Fixed by #598
Closed

rpm: User is removed at uninstalling, which can cause error at reinstalling #597

daipom opened this issue Nov 2, 2023 · 0 comments · Fixed by #598
Labels
bug Something isn't working

Comments

@daipom
Copy link
Contributor

daipom commented Nov 2, 2023

fluent-package v5.0.0 and v5.0.1try to remove User and Group at uninstalling.

the codes in %postun:

if [ $1 -eq 0 ]; then
# Removing
if getent passwd @SERVICE_NAME@ >/dev/null; then
echo "Removing @SERVICE_NAME@ user..."
/usr/sbin/userdel --remove @SERVICE_NAME@
fi
if getent group @SERVICE_NAME@ >/dev/null; then
echo "Removing @SERVICE_NAME@ group..."
/usr/sbin/groupdel @SERVICE_NAME@
fi
if getent passwd @COMPAT_SERVICE_NAME@ >/dev/null; then
echo "Removing @COMPAT_SERVICE_NAME@ user..."
/usr/sbin/userdel --remove @COMPAT_SERVICE_NAME@
fi
if getent group @COMPAT_SERVICE_NAME@ >/dev/null; then
echo "Removing @COMPAT_SERVICE_NAME@ group..."
/usr/sbin/groupdel @COMPAT_SERVICE_NAME@
fi
fi

This behavior is added in the following fix:

It looks like it was influenced by the implementation of apt purge .

For dnf/yum remove, we can't remove User and Group.
The files in /var/log/fluent/ and /etc/fluent/ remain, and they will be used after reinstalling.

If the previous Use or Group is removed, fluent-package creates a new one, and it causes errors in accessing those files.

@daipom daipom linked a pull request Nov 17, 2023 that will close this issue
@daipom daipom added the bug Something isn't working label Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant