debian: fix handling SysV units in disableSystemdUnits
systemctl is-enabled always reports "disabled" for them (actually not a real "disabled", but and error, but exit code is the same). So simply always disable the unit, it is no-op for already disabled ones. BTW systemctl preset also do not work for them.
This commit is contained in:
parent
0f67930d0e
commit
52d502bce2
5
debian/qubes-core-agent.postinst
vendored
5
debian/qubes-core-agent.postinst
vendored
@ -149,7 +149,6 @@ displayFailedStatus() {
|
|||||||
# Disable systemd units
|
# Disable systemd units
|
||||||
disableSystemdUnits() {
|
disableSystemdUnits() {
|
||||||
for unit in $*; do
|
for unit in $*; do
|
||||||
systemctl is-enabled ${unit} > /dev/null 2>&1 && {
|
|
||||||
echo "Disabling ${unit}..."
|
echo "Disabling ${unit}..."
|
||||||
systemctl is-active ${unit} > /dev/null 2>&1 && {
|
systemctl is-active ${unit} > /dev/null 2>&1 && {
|
||||||
systemctl stop ${unit} > /dev/null 2>&1 || displayFailedStatus stop ${unit}
|
systemctl stop ${unit} > /dev/null 2>&1 || displayFailedStatus stop ${unit}
|
||||||
@ -164,10 +163,6 @@ disableSystemdUnits() {
|
|||||||
else
|
else
|
||||||
systemctl disable ${unit} > /dev/null 2>&1 || displayFailedStatus disable ${unit}
|
systemctl disable ${unit} > /dev/null 2>&1 || displayFailedStatus disable ${unit}
|
||||||
fi
|
fi
|
||||||
} || {
|
|
||||||
echo "It appears ${unit} is already disabled!"
|
|
||||||
#displayFailedStatus is-disabled ${unit}
|
|
||||||
}
|
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user