-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
New NixOS services not starting until a second switch in EC2 image #23121
Comments
I'm struggling to understand how
What has me stumped is how brand new services are ever started. The iteration in step 2 runs over pre-existing units, so when I enable What am I missing? How do services get started for the first time ever? The |
So I have no clue why, but reverting #22869 fixes this for me. I'll look at it some more tomorrow but would appreciate any suggestions anyone might have. |
Okay, I investigated further. New services typically get started up by In the case of if (-e $prevUnitFile && ($state->{state} eq "active" || $state->{state} eq "activating")) { Which means that |
We now make it happen later in the boot process so that multi-user has already activated, so as to not run afoul of the logic in switch-to-configuration.pl. It's not my favorite solution, but at least it works. Also added a check to the VM test to catch the failure so we don't break in future. Fixes #23121
For future visitors: if you encounter this error the issue might be elsewhere. Run |
I just built an EC2 image from 15c05ad. I boot it up with userdata (i.e., configuration) that enables a trivial
httpd
server, as follows:If I
journalctl -u amazon-init.service
, I see the following log:Note that it starts
systemd-vconsole-setup.service
(see #23118) but does not starthttpd.service
.I log into the target machine (I can ask it to create users in the new config and those work, so it's clearly getting activated properly) and run
sytemctl status httpd.service
:So the service was added, but nobody bothered starting it. Finally, I run
nixos-rebuild switch
:So it does no work to build a new configuration, but finally notices that
httpd.service
needs to be started.This seems pretty mysterious to me. I'm trying to walk through the
switch-to-configuration.pl
logic to figure out how it decides what to start but I haven't grokked it yet.cc @edolstra
Edit: I'm unsure if this is specific to EC2, but testing on non-EC2 is harder for me.
The text was updated successfully, but these errors were encountered: