Skip to content

Commit

Permalink
fix(node-monitor): make sure it's really stopped
Browse files Browse the repository at this point in the history
Try to prevent this error on some machines:

 Failed to disable unit: Unit file node-monitor.service does not exist.

The error is likely caused by a race condition
  • Loading branch information
gsanchietti committed Feb 28, 2025
1 parent 461dd60 commit ac21bf3
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ set -e

if systemctl -q is-active node-monitor.service; then
echo "Disabling node-monitor as service"
systemctl disable --now node-monitor
rm -f /etc/systemd/system/node-monitor.service
systemctl stop node-monitor || :
# The disable may fail if the update-core has already removed the service file
systemctl disable --now node-monitor || :
rm -fv /etc/systemd/system/node-monitor.service
systemctl daemon-reload
fi

0 comments on commit ac21bf3

Please sign in to comment.