Skip to content
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

Bug 1829642: templates: Add a special machine-config-daemon-firstboot-v42.service #1706

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,21 @@
name: "machine-config-daemon-firstboot-v42.service"
enabled: true
contents: |
[Unit]
Description=Machine Config Daemon Firstboot (4.2 bootimage)
# Make sure it runs only on OSTree booted system
ConditionPathExists=/run/ostree-booted
BindsTo=ignition-firstboot-complete.service
ConditionPathExists=/etc/ignition-machine-config-encapsulated.json
# Note the opposite of this in machine-config-daemon-firstboot
ConditionPathExists=!/sysroot/.coreos-aleph-version.json
After=ignition-firstboot-complete.service
Before=kubelet.service

[Service]
# Need oneshot to delay kubelet
Type=oneshot
ExecStart=/usr/libexec/machine-config-daemon pivot
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this may be dumb, but will this run in 4.1 as well on this conditionpathexists? 4.1 has pivot service in the OS directly so that's gonna be run but this will as well or am I making this up?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good question. So...I think what's going on here right now is you'll notice that
machine-config-daemon-host.service does:

  # If pivot exists, defer to it.  Note similar code in update.go
  ConditionPathExists=!/usr/lib/systemd/system/pivot.service

I think the idea there was that this firstboot.service will try to do the "other stuff" like kernel arguments and the defer the actual "os update' to pivot.service.

But I'm honestly not sure that really makes sense - we might as well take over the whole thing?

This needs investigation - but we're also doing the same thing that the current code is doing so we can't (shouldn't) be making anything worse, right?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep agreed I think it makes sense and it’ll be skipped indeed 🤔


[Install]
WantedBy=multi-user.target
Expand Up @@ -7,6 +7,9 @@ contents: |
ConditionPathExists=/run/ostree-booted
BindsTo=ignition-firstboot-complete.service
ConditionPathExists=/etc/ignition-machine-config-encapsulated.json
# We only want to run on 4.3 clusters and above; this came from
# https://github.com/coreos/coreos-assembler/pull/768
ConditionPathExists=/sysroot/.coreos-aleph-version.json
After=ignition-firstboot-complete.service
Before=kubelet.service

Expand Down