-
-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixops deploy doesn't bring server in desired state because it doesn't start stopped systemd units #1063
Comments
In other words, |
Here's some more info on how things work right now:
After a successful
and we can see:
But as soon as one service having
That also makes it disappear from the is not executed and So, if any service stopped (thus stopping |
A remaining question is whether it should be nixops or |
This makes `nixops deploy` congruent (the declared services will always be running after deploy, no matter what the state of the server was before the deploy).
PR at #1078 |
@nh2 until your work gets merged - do you think there's a better workaround than running With regards to your question: would it hurt to have it in both places at some point in time with nixops leading the way? |
I have the same issue with nixops -- units not reaching nominal state post-deploy, despite being enabled in the Nixops network definition:
|
I stumbled on this issue too. I have to deploy like this to re-trigger the multi-user.target
|
This makes `nixops deploy` congruent (the declared services will always be running after deploy, no matter what the state of the server was before the deploy).
Details on NixOS/nixops#1063 (comment). `partOf` makes that if `smokeping.service` is stopped, `thttpd.service` will be stopped as well. (But not that `thttpd` will be started when `smokeping` is started). Once `thttpd.service` is stopped that way, `Restart = always` will not apply. When the smokeping config options are changed, NixOS's `switch-configuration.pl` will stop `smokeping` (whit shuts down thttpd due to `partOf`), and then restart smokeping; but this does not start thttpd. As a result, thttpd will be off after changing the config, which isn't desired. This commit fixes it by removing the `partOf`, which makes `Restart` work as expected.
Details on NixOS/nixops#1063 (comment). `partOf` makes that if `smokeping.service` is stopped, `thttpd.service` will be stopped as well. (But not that `thttpd` will be started when `smokeping` is started). Once `thttpd.service` is stopped that way, `Restart = always` will not apply. When the smokeping config options are changed, NixOS's `switch-configuration.pl` will stop `smokeping` (whit shuts down thttpd due to `partOf`), and then restart smokeping; but this does not start thttpd. As a result, thttpd will be off after changing the config, which isn't desired. This commit fixes it by removing the `partOf`, which makes `Restart` work as expected.
If my
nginx
shuts down because of some failure in another systemd unit that it depends on, and I fix the issue and deploy with nixops, my nginx isn't actually started.In general, when I run
nixops deploy
, the desired state isn't reached if a unit stopped for some reason.It's only reached with
--force-reboot
ornixops reboot
.I think this is because
nixops deploy
doesn't actuallysystemctl isolate
any target likemulti-user.target
(which is the default target that we putrequiredBy
on in NixOS service modules if we want it to be started).I propose that we should probably
systemctl isolate multi-user.target
duringnixops deploy
.Any opposing views?
The text was updated successfully, but these errors were encountered: