NixOS / nixops

NixOps is a tool for deploying to NixOS machines in a network or cloud.
https://nixos.org/nixops
GNU Lesser General Public License v3.0
1.82k stars 363 forks source link

nixops reboot doesn't work for containers #806

Open nh2 opened 6 years ago

nh2 commented 6 years ago

When using deployment.targetEnv = "container";, nixops reboot doesn't work. It just hangs.

Example:

% nixops reboot -d containerdeployment --include node-1
node-1..> rebooting...
node-1..> waiting for the machine to finish rebooting...[down].....................................................................................
adrianparvino commented 5 years ago

The root problem lies on nixops-keys.service, and containers not setting up networking until successful boot.

adrianparvino commented 5 years ago

Networking setup is: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/virtualisation/containers.nix#L178

adrianparvino commented 5 years ago

This "works":

nixops deploy --allow-reboot --include database & { sleep 5; nixos-container run databas -- touch /run/keys/done; }