delphix / appliance-build

This repository contains the code used to build the Ubuntu-based Delphix Appliance, leveraging open-source tools such as Debian's live-build, Docker, Ansible, OpenZFS, and others.
Apache License 2.0
19 stars 41 forks source link

DLPX-84565 telegraf.service restarts after upgrade when it should be masked #739

Closed palash-gandhi closed 11 months ago

palash-gandhi commented 12 months ago

Problem

The telegraf package enables `telegraf.service`. The service ends up in a restart loop as noted in the Jira. While the service is masked and disabled on a fresh install, there is nothing in the upgrade logic to mask this service.

Solution

Mask it like other services.

Testing Done

ab-pre-push: http://selfservice.jenkins.delphix.com/job/appliance-build-orchestrator-pre-push/7191/console Manual test: Upgrade from 6.0.13.0 to 7.0 to 16.0 and verify telegraf.service is not running http://selfservice.jenkins.delphix.com/job/blackbox-chained/5396/console From the syslog: During verify: ``` Oct 5 08:11:05 ip-10-110-240-233 upgrade-scripts:upgrade-container[11483]: //var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance- build-develop-pre-push-1584/common.sh:fix_and_migrate_services:448 systemctl is-enabled telegraf Oct 5 08:11:05 ip-10-110-240-233 upgrade-scripts:upgrade-container[11483]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-b uild-develop-pre-push-1584/common.sh:fix_and_migrate_services:448 [[ enabled == enabled ]] Oct 5 08:11:05 ip-10-110-240-233 upgrade-scripts:upgrade-container[11483]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-develop-pre-push-1584/common.sh:fix_and_migrate_services:449 mask_service telegraf delphix.iyDDbhM Oct 5 08:11:05 ip-10-110-240-233 upgrade-scripts:upgrade-container[11483]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-develop-pre-push-1584/common.sh:mask_service:374 local svc=telegraf Oct 5 08:11:05 ip-10-110-240-233 upgrade-scripts:upgrade-container[11483]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-develop-pre-push-1584/common.sh:mask_service:375 local container=delphix.iyDDbhM Oct 5 08:11:05 ip-10-110-240-233 upgrade-scripts:upgrade-container[11483]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-develop-pre-push-1584/common.sh:mask_service:380 [[ -n delphix.iyDDbhM ]] Oct 5 08:11:05 ip-10-110-240-233 upgrade-scripts:upgrade-container[11483]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-develop-pre-push-1584/common.sh:mask_service:381 chroot /var/lib/machines/delphix.iyDDbhM systemctl mask telegraf ... ... Oct 5 08:11:05 ip-10-110-240-233 upgrade-scripts:upgrade-container[11483]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-b uild-develop-pre-push-1584/common.sh:fix_and_migrate_services:478 is_svc_new_or_masked_or_disabled telegraf.service Oct 5 08:11:05 ip-10-110-240-233 upgrade-scripts:upgrade-container[11483]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-b uild-develop-pre-push-1584/common.sh:is_svc_new_or_masked_or_disabled:389 local svc=telegraf.service Oct 5 08:11:05 ip-10-110-240-233 upgrade-scripts:upgrade-container[11483]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-develop-pre-push-1584/common.sh:is_svc_new_or_masked_or_disabled:391 systemctl cat telegraf.service Oct 5 08:11:05 ip-10-110-240-233 upgrade-scripts:upgrade-container[11483]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-develop-pre-push-1584/common.sh:is_svc_new_or_masked_or_disabled:392 '[' 0 -eq 1 ']' Oct 5 08:11:05 ip-10-110-240-233 upgrade-scripts:upgrade-container[11483]: //var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-develop-pre-push-1584/common.sh:is_svc_new_or_masked_or_disabled:396 systemctl is-enabled telegraf.service Oct 5 08:11:05 ip-10-110-240-233 upgrade-scripts:upgrade-container[11483]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-develop-pre-push-1584/common.sh:is_svc_new_or_masked_or_disabled:396 state=enabled Oct 5 08:11:05 ip-10-110-240-233 upgrade-scripts:upgrade-container[11483]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-develop-pre-push-1584/common.sh:is_svc_new_or_masked_or_disabled:397 [[ enabled == masked ]] Oct 5 08:11:05 ip-10-110-240-233 upgrade-scripts:upgrade-container[11483]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-develop-pre-push-1584/common.sh:is_svc_new_or_masked_or_disabled:397 [[ enabled == disabled ]] Oct 5 08:11:05 ip-10-110-240-233 upgrade-scripts:upgrade-container[11483]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-develop-pre-push-1584/common.sh:is_svc_new_or_masked_or_disabled:401 return 1 ``` During apply: ``` Oct 5 08:39:50 ip-10-110-240-233 upgrade-scripts:execute[83847]: //var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-develop-pre-push-1584/common.sh:fix_and_migrate_services:448 systemctl is-enabled telegraf Oct 5 08:39:50 ip-10-110-240-233 upgrade-scripts:execute[83847]: telegraf.service is not a native service, redirecting to systemd-sysv-install. Oct 5 08:39:50 ip-10-110-240-233 upgrade-scripts:execute[83847]: Executing: /lib/systemd/systemd-sysv-install is-enabled telegraf Oct 5 08:39:50 ip-10-110-240-233 upgrade-scripts:execute[83847]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-devel op-pre-push-1584/common.sh:fix_and_migrate_services:448 [[ enabled == enabled ]] Oct 5 08:39:50 ip-10-110-240-233 upgrade-scripts:execute[83847]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-devel op-pre-push-1584/common.sh:fix_and_migrate_services:449 mask_service telegraf '' Oct 5 08:39:50 ip-10-110-240-233 upgrade-scripts:execute[83847]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-devel op-pre-push-1584/common.sh:mask_service:374 local svc=telegraf Oct 5 08:39:50 ip-10-110-240-233 upgrade-scripts:execute[83847]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-devel op-pre-push-1584/common.sh:mask_service:375 local container= Oct 5 08:39:50 ip-10-110-240-233 upgrade-scripts:execute[83847]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-devel op-pre-push-1584/common.sh:mask_service:380 [[ -n '' ]] Oct 5 08:39:50 ip-10-110-240-233 upgrade-scripts:execute[83847]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-devel op-pre-push-1584/common.sh:mask_service:384 systemctl mask --now telegraf Oct 5 08:39:50 ip-10-110-240-233 upgrade-scripts:execute[83847]: Created symlink /etc/systemd/system/telegraf.service → /dev/null. Oct 5 08:39:50 ip-10-110-240-233 systemd[1]: Reloading. Oct 5 08:39:51 ip-10-110-240-233 systemd[1]: Stopping telegraf.service... Oct 5 08:39:51 ip-10-110-240-233 systemd[1]: telegraf.service: Succeeded. Oct 5 08:39:51 ip-10-110-240-233 systemd[1]: Stopped telegraf.service. ... ... Oct 5 08:39:54 ip-10-110-240-233 upgrade-scripts:execute[83847]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-devel op-pre-push-1584/common.sh:fix_and_migrate_services:478 is_svc_new_or_masked_or_disabled telegraf.service Oct 5 08:39:54 ip-10-110-240-233 upgrade-scripts:execute[83847]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-devel op-pre-push-1584/common.sh:is_svc_new_or_masked_or_disabled:389 local svc=telegraf.service Oct 5 08:39:54 ip-10-110-240-233 upgrade-scripts:execute[83847]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-devel op-pre-push-1584/common.sh:is_svc_new_or_masked_or_disabled:391 systemctl cat telegraf.service Oct 5 08:39:54 ip-10-110-240-233 upgrade-scripts:execute[83847]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-devel op-pre-push-1584/common.sh:is_svc_new_or_masked_or_disabled:392 '[' 0 -eq 1 ']' Oct 5 08:39:54 ip-10-110-240-233 upgrade-scripts:execute[83847]: //var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-deve lop-pre-push-1584/common.sh:is_svc_new_or_masked_or_disabled:396 systemctl is-enabled telegraf.service Oct 5 08:39:54 ip-10-110-240-233 upgrade-scripts:execute[83847]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-devel op-pre-push-1584/common.sh:is_svc_new_or_masked_or_disabled:396 state=masked Oct 5 08:39:54 ip-10-110-240-233 upgrade-scripts:execute[83847]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-devel op-pre-push-1584/common.sh:is_svc_new_or_masked_or_disabled:397 [[ masked == masked ]] Oct 5 08:39:54 ip-10-110-240-233 upgrade-scripts:execute[83847]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-devel op-pre-push-1584/common.sh:is_svc_new_or_masked_or_disabled:398 return 0 Oct 5 08:39:54 ip-10-110-240-233 upgrade-scripts:execute[83847]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-devel op-pre-push-1584/common.sh:fix_and_migrate_services:479 mask_service telegraf.service '' Oct 5 08:39:54 ip-10-110-240-233 upgrade-scripts:execute[83847]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-devel op-pre-push-1584/common.sh:mask_service:374 local svc=telegraf.service Oct 5 08:39:54 ip-10-110-240-233 upgrade-scripts:execute[83847]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-devel op-pre-push-1584/common.sh:mask_service:375 local container= Oct 5 08:39:54 ip-10-110-240-233 upgrade-scripts:execute[83847]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-devel op-pre-push-1584/common.sh:mask_service:380 [[ -n '' ]] Oct 5 08:39:54 ip-10-110-240-233 upgrade-scripts:execute[83847]: /var/dlpx-update/16.0.0.0-snapshot.20231004163329604+jenkins-selfservice-appliance-build-devel op-pre-push-1584/common.sh:mask_service:384 systemctl mask --now telegraf.service ```