diff --git a/configuration/package_manifests/nfpm.tedge-agent.yaml b/configuration/package_manifests/nfpm.tedge-agent.yaml index feab780b9f2..15a1be58ef1 100644 --- a/configuration/package_manifests/nfpm.tedge-agent.yaml +++ b/configuration/package_manifests/nfpm.tedge-agent.yaml @@ -20,16 +20,18 @@ replaces: - tedge_agent provides: - tedge_agent -conflicts: - - tedge_agent (<= 0.8.1) + +# WARNING: Don't use conflicts or breaks as this causes the old packages prerm script to be executed +# which stops the tedge-agent thus causing the OTA to be stuck in EXECUTING. +# One disadvantage is that the tedge_agent package needs to be manually removed after upgrading. The new +# tedge-agent package removes the legacy tedge_agent.prerm script to prevent the new service from being +# stopped as well. deb: fields: Vcs-Browser: ${CI_PROJECT_URL} Vcs-Git: ${CI_PROJECT_URL} compression: xz - breaks: - - tedge_agent (<= 0.8.1) contents: # service definitions diff --git a/configuration/package_scripts/_generated/tedge-agent/apk/postinst b/configuration/package_scripts/_generated/tedge-agent/apk/postinst index a4b07928b19..838b156aea3 100644 --- a/configuration/package_scripts/_generated/tedge-agent/apk/postinst +++ b/configuration/package_scripts/_generated/tedge-agent/apk/postinst @@ -5,5 +5,8 @@ set -e # Prevent purge from deleting files related to the package rm -f /var/lib/dpkg/info/tedge_agent.postrm +# Remove older prerm maintainer scripts which would stop the tedge-agent service during an OTA +rm -f /var/lib/dpkg/info/tedge_agent.prerm + diff --git a/configuration/package_scripts/_generated/tedge-agent/deb/postinst b/configuration/package_scripts/_generated/tedge-agent/deb/postinst index d1fa8c6ad8f..39cf1d51b1b 100755 --- a/configuration/package_scripts/_generated/tedge-agent/deb/postinst +++ b/configuration/package_scripts/_generated/tedge-agent/deb/postinst @@ -5,6 +5,9 @@ set -e # Prevent purge from deleting files related to the package rm -f /var/lib/dpkg/info/tedge_agent.postrm +# Remove older prerm maintainer scripts which would stop the tedge-agent service during an OTA +rm -f /var/lib/dpkg/info/tedge_agent.prerm + # Automatically added by thin-edge.io if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then if deb-systemd-helper debian-installed tedge-agent.service; then diff --git a/configuration/package_scripts/_generated/tedge-agent/rpm/postinst b/configuration/package_scripts/_generated/tedge-agent/rpm/postinst index 059178ef838..25a79dda548 100644 --- a/configuration/package_scripts/_generated/tedge-agent/rpm/postinst +++ b/configuration/package_scripts/_generated/tedge-agent/rpm/postinst @@ -5,6 +5,9 @@ set -e # Prevent purge from deleting files related to the package rm -f /var/lib/dpkg/info/tedge_agent.postrm +# Remove older prerm maintainer scripts which would stop the tedge-agent service during an OTA +rm -f /var/lib/dpkg/info/tedge_agent.prerm + # Automatically added by thin-edge.io if [ $1 -eq 1 ] && [ -x "/usr/lib/systemd/systemd-update-helper" ]; then # Initial installation diff --git a/configuration/package_scripts/tedge-agent/postinst b/configuration/package_scripts/tedge-agent/postinst index 73c39a0e910..ae50630984f 100644 --- a/configuration/package_scripts/tedge-agent/postinst +++ b/configuration/package_scripts/tedge-agent/postinst @@ -5,4 +5,7 @@ set -e # Prevent purge from deleting files related to the package rm -f /var/lib/dpkg/info/tedge_agent.postrm +# Remove older prerm maintainer scripts which would stop the tedge-agent service during an OTA +rm -f /var/lib/dpkg/info/tedge_agent.prerm + #LINUXHELPER# diff --git a/tests/RobotFramework/tests/cumulocity/self-update/tedge_self_update.robot b/tests/RobotFramework/tests/cumulocity/self-update/tedge_self_update.robot index 53f24e5803a..1a77afc7480 100644 --- a/tests/RobotFramework/tests/cumulocity/self-update/tedge_self_update.robot +++ b/tests/RobotFramework/tests/cumulocity/self-update/tedge_self_update.robot @@ -28,10 +28,10 @@ Update tedge version from previous using Cumulocity # Install desired version Create Local Repository - [Documentation] tedge-agent causes a problem where the operation is stuck in EXECUTING state - ${OPERATION}= Install Software tedge,${NEW_VERSION} tedge-mapper,${NEW_VERSION} tedge-watchdog,${NEW_VERSION} tedge-log-plugin,${NEW_VERSION} c8y-configuration-plugin,${NEW_VERSION} tedge-apt-plugin,${NEW_VERSION} + ${OPERATION}= Install Software tedge,${NEW_VERSION} tedge-mapper,${NEW_VERSION} tedge-agent,${NEW_VERSION} tedge-watchdog,${NEW_VERSION} tedge-log-plugin,${NEW_VERSION} c8y-configuration-plugin,${NEW_VERSION} tedge-apt-plugin,${NEW_VERSION} Operation Should Be SUCCESSFUL ${OPERATION} timeout=180 - Device Should Have Installed Software tedge,${NEW_VERSION_ESCAPED}::apt tedge-mapper,${NEW_VERSION_ESCAPED}::apt tedge-watchdog,${NEW_VERSION_ESCAPED}::apt c8y-configuration-plugin,${NEW_VERSION_ESCAPED}::apt tedge-log-plugin,${NEW_VERSION_ESCAPED}::apt tedge-apt-plugin,${NEW_VERSION_ESCAPED}::apt + + Device Should Have Installed Software tedge,${NEW_VERSION_ESCAPED}::apt tedge-mapper,${NEW_VERSION_ESCAPED}::apt tedge-agent,${NEW_VERSION_ESCAPED}::apt tedge-watchdog,${NEW_VERSION_ESCAPED}::apt c8y-configuration-plugin,${NEW_VERSION_ESCAPED}::apt tedge-log-plugin,${NEW_VERSION_ESCAPED}::apt tedge-apt-plugin,${NEW_VERSION_ESCAPED}::apt # Check if services are still stopped and disabled ${OUTPUT} Execute Command systemctl is-active tedge-mapper-az || exit 1 exp_exit_code=1 strip=True