Closed chris-martin closed 6 years ago
Yes, I understand what's going on here. ~We have fixed this in a few other tools too so when I have a minute I'll get a PR out.~
If the status code returned by switch-to-configuration
let's us discriminate between success and failure then we could provide a more useful and specific message to the user (or just treat it as success even though a service failed to start or restart.)
Based on looking at the switch-to-configuration
script, I think it will return an exit code of 4
if any services fail: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/system/activation/switch-to-configuration.pl#L461
If I deploy and a service fails to start, nix-deploy gives me an error message that indicates that sudo failed on the target machine.
In fact the deploy did complete, and the errors are unrelated to sudoing.