From 15bf82eaaa8471aea202d6777f1de37fd1ecbaf7 Mon Sep 17 00:00:00 2001 From: Kentaro Hayashi Date: Tue, 7 Nov 2023 17:29:39 +0900 Subject: [PATCH] rpm: test whether system account is kept or not Signed-off-by: Kentaro Hayashi --- fluent-package/yum/install-test.sh | 4 ++-- fluent-package/yum/systemd-test/install-newly.sh | 3 +++ fluent-package/yum/systemd-test/update-from-v4.sh | 5 +++++ .../update-to-next-version-with-backward-compat-for-v4.sh | 6 ++++++ fluent-package/yum/systemd-test/update-to-next-version.sh | 5 +++++ 5 files changed, 21 insertions(+), 2 deletions(-) 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..7036e09e6 100755 --- a/fluent-package/yum/systemd-test/install-newly.sh +++ b/fluent-package/yum/systemd-test/install-newly.sh @@ -46,6 +46,9 @@ test -e /var/log/fluent/fluentd.log sudo $DNF remove -y fluent-package sudo systemctl daemon-reload +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-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`.