Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
daemon/update: disable systemd unit before overwriting
When overwriting a systemd unit with new content, we need to account for the case where the new unit content has a different `[Install]` section. If it does, then simply overwriting will leak the previous enablement symlinks and become node state. That's OK most of the time, but this can cause real issues as we've seen with the combination of openshift#3967 which does exactly that (changing `[Install]` sections) and openshift#4213 which assumed that those symlinks were cleaned up. More details on that cocktail in: https://issues.redhat.com/browse/OCPBUGS-33694?focusedId=24917003#comment-24917003 Fix this by always checking if the unit is currently enabled, and if so, running `systemctl disable` *before* overwriting its contents. The unit will then be re-enabled (or not) based on the MachineConfig. Fixes: https://issues.redhat.com/browse/OCPBUGS-33694
- Loading branch information