-
Notifications
You must be signed in to change notification settings - Fork 247
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
Ignition shouldn't use systemd presets to enable units #588
Comments
Comment by @lucab I'd need to dig into this a bit more, but I think this would not work with services provided via torcx as the service units do not yet exist when ignition is run. Moreover I think the decision to using presets came after lessons learned from cloudinit issues, but I don't have the specific details at hand. |
Comment by @euank To duplicate some discussion with @bgilbert: It seems plausible that we could split In the case of "things that exist", we can create symlinks. This includes aliases and templated units. For things that don't, we could use a preset + log a warning. This would include torcx units and other units not written by Ignition directly. Perhaps in the long term torcx should have an initrd component which handles unit enablement in its own way, and somehow coordinates with Ignition's intent to let user's override it? |
Comment by @bgilbert A torcx initrd component seems to add significant complexity. In principle any unit written but not enabled by a generator would need to be enabled via preset (i.e. it's not necessarily just a torcx issue) but I don't know if that's common. Logging a warning would address #587, and as an additional notification mechanism we could write a unit whose sole job is to fail if any of the units enabled via preset weren't actually enabled. |
Comment by @cgwalters Just to be sure I understand so far:
would break torcx? |
Comment by @ajeddeloh IIRC |
Comment by @cgwalters See systemd/systemd#7631 for systemctl and dbus. |
Comment by @cgwalters In the end |
Comment by @cgwalters I see a few paths here. One is to enhance systemd in some way to make this nicer. It could be enhancing the preset file. For #587, it could be as simple as:
Which would be like That said, we could likely kill all of these issues at once if (as this issue suggests) we don't use presets, but instead write out a small systemd service that runs in early boot that does basically:
|
Comment by @bgilbert One of the major lessons from coreos-cloudinit is that services shouldn't be fiddling with the boot process. We could use a generator, though. |
Comment by @cgwalters
The tricky thing there is generators are designed to be transient. So Ignition would have to write out something like |
Comment by @ajeddeloh It sounds like we need to figure out what failure in the real root looks like. We generally want failures to take the machine down entirely (e.g. Ignition failures prevent the switch-root from ever happening). Failing in the real root is less "bulletproof" as failing in the initramfs. Users can work around it and it doesn't set off all sorts of alarms like the initramfs failures. |
@cgwalters @lucab Given the apparent deprecation of torcx, is the case of "service units that do not yet exist" still valid? |
Probably not relevant anymore. See: #588 (comment) I'm +1 to move forward on this issue and to move away from the use of presets to enable symlinks on first boot. We should however keep a way to enable transient / runtime units via Ignition and the presets might be a good way to do that. This would be required for example for https://github.com/containers/quadlet, which generates service units at runtime from static definitions. Quadlet is not currently included in FCOS (coreos/fedora-coreos-tracker#998) but could be in the future. There might also be other cases where this could be useful. Example Ignition config:
Other suggestions:
|
+1 |
Update: Quadlet enables the units it generates, thus this example is not relevant: https://github.com/containers/quadlet/blob/1e83798d144bfb659c9293d47ef26c282aabea3d/src/generator.c#L890-L891 |
Issue by @bgilbert
Issue Report
Environment
Any
Desired Feature
Ignition should create the requisite unit symlinks itself, rather than using systemd presets.
Other Information
This would solve multiple problems: #583, #586, #587.
The text was updated successfully, but these errors were encountered: