Only stop the nix daemon if it's actually active, not just enabled (#410)
* Only stop the nix daemon if it's actually active, not just enabled * Add vm-tests
This commit is contained in:
parent
352a50b921
commit
16ddada7a3
|
@ -236,6 +236,17 @@ let
|
|||
uninstall = installCases.install-default.uninstall;
|
||||
uninstallCheck = installCases.install-default.uninstallCheck;
|
||||
};
|
||||
cure-self-multi-broken-daemon-stopped = {
|
||||
preinstall = ''
|
||||
${nix-installer-install-quiet}
|
||||
sudo mv /nix/receipt.json /nix/old-receipt.json
|
||||
sudo systemctl stop nix-daemon.socket
|
||||
'';
|
||||
install = installCases.install-default.install;
|
||||
check = installCases.install-default.check;
|
||||
uninstall = installCases.install-default.uninstall;
|
||||
uninstallCheck = installCases.install-default.uninstallCheck;
|
||||
};
|
||||
cure-self-linux-broken-no-etc-nix = {
|
||||
preinstall = ''
|
||||
${nix-installer-install-quiet}
|
||||
|
@ -290,6 +301,16 @@ let
|
|||
uninstall = installCases.install-default.uninstall;
|
||||
uninstallCheck = installCases.install-default.uninstallCheck;
|
||||
};
|
||||
cure-script-multi-broken-daemon-stopped = {
|
||||
preinstall = ''
|
||||
${cure-script-multi-user}
|
||||
sudo systemctl stop nix-daemon.socket
|
||||
'';
|
||||
install = installCases.install-default.install;
|
||||
check = installCases.install-default.check;
|
||||
uninstall = installCases.install-default.uninstall;
|
||||
uninstallCheck = installCases.install-default.uninstallCheck;
|
||||
};
|
||||
cure-script-multi-broken-no-etc-nix = {
|
||||
preinstall = ''
|
||||
${cure-script-multi-user}
|
||||
|
|
|
@ -246,13 +246,13 @@ impl Action for ConfigureInitService {
|
|||
.map_err(Self::error)?;
|
||||
}
|
||||
// The goal state is the `socket` enabled and active, the service not enabled and stopped (it activates via socket activation)
|
||||
let socket_was_active =
|
||||
if is_enabled("nix-daemon.socket").await.map_err(Self::error)? {
|
||||
disable("nix-daemon.socket", true)
|
||||
disable("nix-daemon.socket", false)
|
||||
.await
|
||||
.map_err(Self::error)?;
|
||||
true
|
||||
} else if is_active("nix-daemon.socket").await.map_err(Self::error)? {
|
||||
}
|
||||
let socket_was_active =
|
||||
if is_active("nix-daemon.socket").await.map_err(Self::error)? {
|
||||
stop("nix-daemon.socket").await.map_err(Self::error)?;
|
||||
true
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue