diff --git a/fluent-package/yum/fluent-package.spec.in b/fluent-package/yum/fluent-package.spec.in index 1c945eca0..512cddab2 100644 --- a/fluent-package/yum/fluent-package.spec.in +++ b/fluent-package/yum/fluent-package.spec.in @@ -284,26 +284,6 @@ if [ $1 -eq 0 ]; then fi fi -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 - %posttrans if [ -f %{v4migration} ]; then if [ ! -f /usr/sbin/@COMPAT_SERVICE_NAME@ ]; then diff --git a/fluent-package/yum/install-test.sh b/fluent-package/yum/install-test.sh index f114cb1d1..0fed1ae5e 100755 --- a/fluent-package/yum/install-test.sh +++ b/fluent-package/yum/install-test.sh @@ -83,8 +83,8 @@ for conf_path in /etc/td-agent/td-agent.conf /etc/fluent/fluentd.conf; do fi done -(! getent passwd fluentd >/dev/null) -(! getent group fluentd >/dev/null) +getent passwd fluentd >/dev/null +getent group fluentd >/dev/null if [ $ENABLE_UPGRADE_TEST -eq 1 ]; then echo "UPGRADE TEST from v4" diff --git a/fluent-package/yum/systemd-test/install-newly.sh b/fluent-package/yum/systemd-test/install-newly.sh index d1bebf6f2..c30d57791 100755 --- a/fluent-package/yum/systemd-test/install-newly.sh +++ b/fluent-package/yum/systemd-test/install-newly.sh @@ -46,6 +46,18 @@ test -e /var/log/fluent/fluentd.log sudo $DNF remove -y fluent-package sudo systemctl daemon-reload +case $1 in + local) + getent passwd fluentd >/dev/null + getent group fluentd >/dev/null + ;; + *) + # TODO: Remove this branch after the following fix is applied to the latest release. + # https://github.com/fluent/fluent-package-builder/pull/598 + (! getent passwd fluentd >/dev/null) + (! getent group fluentd >/dev/null) + ;; +esac # `sudo systemctl daemon-reload` clears the service completely. # (The result of `systemctl status` will be `unfound`) # Note: RPM does not leave links like `@/etc/systemd/system/fluentd.service`. diff --git a/fluent-package/yum/systemd-test/update-from-v4.sh b/fluent-package/yum/systemd-test/update-from-v4.sh index 18dd7d5df..735d35834 100755 --- a/fluent-package/yum/systemd-test/update-from-v4.sh +++ b/fluent-package/yum/systemd-test/update-from-v4.sh @@ -78,6 +78,11 @@ test -e /var/log/fluent/fluentd.log sudo $DNF remove -y fluent-package sudo systemctl daemon-reload +getent passwd td-agent >/dev/null +getent group td-agent >/dev/null +getent passwd fluentd >/dev/null +getent group fluentd >/dev/null + # `sudo systemctl daemon-reload` clears the service completely. # (The result of `systemctl status` will be `unfound`) # Note: RPM does not leave links like `@/etc/systemd/system/fluentd.service`. diff --git a/fluent-package/yum/systemd-test/update-to-next-version-with-backward-compat-for-v4.sh b/fluent-package/yum/systemd-test/update-to-next-version-with-backward-compat-for-v4.sh index f633ae26d..678d2301a 100755 --- a/fluent-package/yum/systemd-test/update-to-next-version-with-backward-compat-for-v4.sh +++ b/fluent-package/yum/systemd-test/update-to-next-version-with-backward-compat-for-v4.sh @@ -97,3 +97,9 @@ test -e /var/log/fluent/fluentd.log sudo $DNF remove -y fluent-package (! systemctl status --no-pager td-agent) (! systemctl status --no-pager fluentd) + +getent passwd td-agent >/dev/null +getent group td-agent >/dev/null +getent passwd fluentd >/dev/null +getent group fluentd >/dev/null + diff --git a/fluent-package/yum/systemd-test/update-to-next-version.sh b/fluent-package/yum/systemd-test/update-to-next-version.sh index f2af2a082..aac01ecb6 100755 --- a/fluent-package/yum/systemd-test/update-to-next-version.sh +++ b/fluent-package/yum/systemd-test/update-to-next-version.sh @@ -62,6 +62,11 @@ test -e /var/log/fluent/fluentd.log sudo $DNF remove -y fluent-package sudo systemctl daemon-reload +(! getent passwd td-agent >/dev/null) +(! getent group td-agent >/dev/null) +getent passwd fluentd >/dev/null +getent group fluentd >/dev/null + # `sudo systemctl daemon-reload` clears the service completely. # (The result of `systemctl status` will be `unfound`) # Note: RPM does not leave links like `@/etc/systemd/system/fluentd.service`.