From c47d5367f789e6b77e2f925aca47dd33745f2091 Mon Sep 17 00:00:00 2001 From: Shizuo Fujita Date: Mon, 25 Nov 2024 16:12:41 +0900 Subject: [PATCH] system-test: clean up a code where it retrieves pid Signed-off-by: Shizuo Fujita --- .../yum/systemd-test/downgrade-to-v4.sh | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/fluent-package/yum/systemd-test/downgrade-to-v4.sh b/fluent-package/yum/systemd-test/downgrade-to-v4.sh index 1eb382631..244667380 100755 --- a/fluent-package/yum/systemd-test/downgrade-to-v4.sh +++ b/fluent-package/yum/systemd-test/downgrade-to-v4.sh @@ -80,22 +80,7 @@ test -x /usr/sbin/td-agent test -x /usr/sbin/td-agent-gem # Test: environmental variables -case ${distribution} in - centos|amazon) - # --value is not supported yet - pid=$(systemctl show td-agent --property=MainPID | cut -d'=' -f2) - ;; - amazon) - if [ ! "$DISTRIBUTION_VERSION" = "2023" ]; then - pid=$(systemctl show td-agent --property=MainPID | cut -d'=' -f2) - else - pid=$(systemctl show td-agent --property=MainPID --value) - fi - ;; - *) - pid=$(systemctl show td-agent --property=MainPID --value) - ;; -esac +pid=$(eval $(systemctl show fluentd --property=MainPID) && echo $MainPID) env_vars=$(sudo sed -e 's/\x0/\n/g' /proc/$pid/environ) test $(eval $env_vars && echo $HOME) = "/var/lib/td-agent" test $(eval $env_vars && echo $LOGNAME) = "td-agent"