diff --git a/fluent-package/apt/systemd-test/update-to-next-version-service-status.sh b/fluent-package/apt/systemd-test/update-to-next-version-service-status.sh index 13387dbc..df347a52 100755 --- a/fluent-package/apt/systemd-test/update-to-next-version-service-status.sh +++ b/fluent-package/apt/systemd-test/update-to-next-version-service-status.sh @@ -46,7 +46,20 @@ if [ "$status_before_update" = active ]; then # The service should NOT restart automatically after update # (The process before update should continue to run) systemctl is-active fluentd - test $main_pid -eq $(systemctl show --value --property=MainPID fluentd) + . /etc/os-release + case $VERSION_CODENAME in + noble) + if dpkg-query --show --showformat '${Version}' needrestart; then + # If needrestart is available, restart will be fired out of maintainer script + (! test $main_pid -eq $(systemctl show --value --property=MainPID fluentd)) + else + test $main_pid -eq $(systemctl show --value --property=MainPID fluentd) + fi + ;; + *) + test $main_pid -eq $(systemctl show --value --property=MainPID fluentd) + ;; + esac elif [ "$enabled_before_update" = enabled ]; then # The service should start automatically systemctl is-active fluentd diff --git a/fluent-package/apt/systemd-test/update-to-next-version.sh b/fluent-package/apt/systemd-test/update-to-next-version.sh index 4e4f858e..a4e14e7f 100755 --- a/fluent-package/apt/systemd-test/update-to-next-version.sh +++ b/fluent-package/apt/systemd-test/update-to-next-version.sh @@ -44,7 +44,20 @@ test $(eval $env_vars && echo $FLUENT_PLUGIN) = "/etc/fluent/plugin" test $(eval $env_vars && echo $FLUENT_SOCKET) = "/var/run/fluent/fluentd.sock" # FLUENT_PACKAGE_VERSION will be updated after the next restart # TODO: consider how to test the update of version info -(! test $(eval $env_vars && echo $FLUENT_PACKAGE_VERSION) = "$next_package_ver") +. /etc/os-release +case $VERSION_CODENAME in + noble) + if dpkg-query --show --showformat '${Version}' needrestart; then + # If needrestart is available, restart will be fired out of maintainer script + test $(eval $env_vars && echo $FLUENT_PACKAGE_VERSION) = "$next_package_ver" + else + (! test $(eval $env_vars && echo $FLUENT_PACKAGE_VERSION) = "$next_package_ver") + fi + ;; + *) + (! test $(eval $env_vars && echo $FLUENT_PACKAGE_VERSION) = "$next_package_ver") + ;; +esac # Test: fluent-diagtool sudo fluent-gem install fluent-plugin-concat