Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/exec/util: check if unit exists before disabling
Ignition depends on `systemctl disable` for disabling units. Currently if the unit does not exist `systemctl disable` exits 1; however, before 252 `systemctrl disable` exits 0 if `--root` is specified. Since Ignition depends on systemctrl's exit code this change caused a regression, and causing the unit.remove.symlinks blackbox test to fail with: removing enablement symlink(s) for "enoent.service": cannot remove symlink(s) for enoent.service: exit status 1: "Failed to disable unit, unit enoent.service does not exist.\n" Before disabling a unit, use `systemctl is-enabled` to verify that the unit exists and is enabled. Fixes coreos#1614.
- Loading branch information