Skip to content

Commit

Permalink
DLPX-84565 telegraf.service restarts after upgrade when it should be …
Browse files Browse the repository at this point in the history
  • Loading branch information
palash-gandhi committed Oct 16, 2023
1 parent 8f571d5 commit 6a42a15
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
13 changes: 12 additions & 1 deletion upgrade/upgrade-scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ function mask_service() {
chroot "/var/lib/machines/$container" systemctl mask "$svc" ||
die "failed to mask '$svc' in container '$container'"
else
systemctl mask "$svc" || die "failed to mask '$svc'"
systemctl mask --now "$svc" || die "failed to mask '$svc'"
fi
}

Expand Down Expand Up @@ -442,6 +442,16 @@ function fix_and_migrate_services() {
fi
fi

#
# Due to https://github.com/influxdata/telegraf/issues/14052, telegraf must be masked after
# packages are upgraded. The telegraf package removes /etc/systemd/system/telegraf.service thus
# reversing the `systemctl mask` operation performed before the packages are upgraded.
# Once this issue is fixed, this can be removed.
#
if [[ "$(systemctl is-enabled telegraf)" == enabled ]]; then
mask_service telegraf "$container"
fi

#
# The services listed below are either permanently disabled or can be
# dynamically modified by the application(s) running on the appliance,
Expand Down Expand Up @@ -483,5 +493,6 @@ function fix_and_migrate_services() {
snmpd.service
systemd-timesyncd.service
td-agent.service
telegraf.service
EOF
}
10 changes: 10 additions & 0 deletions upgrade/upgrade-scripts/execute
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,16 @@ dpkg-query -Wf '${Conffiles}\n' | awk '$3 == "obsolete" {print $1}' |
die "failed to reinstall package '$package'"
done || die "failed to remove obsolete package configuration files"

#
# Due to https://github.com/influxdata/telegraf/issues/14052, telegraf must be masked after
# packages are upgraded. The telegraf package removes /etc/systemd/system/telegraf.service thus
# reversing the `systemctl mask` operation performed before the packages are upgraded.
# Once this issue is fixed, this can be removed.
#
if [[ "$(systemctl is-enabled telegraf)" == enabled ]]; then
systemctl mask --now telegraf.service
fi

#
# Unmask docker, which was masked at the beginning of the upgrade due
# to DLPX-77949.
Expand Down

0 comments on commit 6a42a15

Please sign in to comment.