Skip to content

Commit

Permalink
coreos-base/afterburn: do not start coreos-metadata.service on qemu
Browse files Browse the repository at this point in the history
QEMU is not supported by Afterburn, let's add an extra-check to be sure
that the service will not run on this platform.

On cloud-init provisioned system, units are wrote in '/etc' after a
certain moment, if a unit takes precedence on one in '/usr' the one in
'/usr' would have certainly already started. That's the case for
'coreos-metadata.service' (wrote in '/etc' by cloud-init but already
available in '/usr').

```
$ journalctl -u coreos-metadata.service
Sep 29 07:37:57 localhost systemd[1]: Starting coreos-metadata.service - Flatcar Metadata Agent...
Sep 29 07:37:57 localhost coreos-metadata[1266]: Error: failed to run
Sep 29 07:37:57 localhost coreos-metadata[1266]: Caused by:
Sep 29 07:37:57 localhost coreos-metadata[1266]:     0: fetching metadata from provider
Sep 29 07:37:57 localhost coreos-metadata[1266]:     1: unknown provider 'qemu'
Sep 29 07:37:57 localhost systemd[1]: coreos-metadata.service: Main process exited, code=exited, status=1/FAILURE
Sep 29 07:37:57 localhost systemd[1]: coreos-metadata.service: Failed with result 'exit-code'.
Sep 29 07:37:57 localhost systemd[1]: Failed to start coreos-metadata.service - Flatcar Metadata Agent.
Sep 29 07:37:58 core1 systemd[1]: coreos-metadata.service: Scheduled restart job, restart counter is at 1.
Sep 29 07:37:58 core1 systemd[1]: Stopped coreos-metadata.service - QEMU metadata agent.
Sep 29 07:37:58 core1 systemd[1]: Starting coreos-metadata.service - QEMU metadata agent...
Sep 29 07:37:58 core1 systemd[1]: coreos-metadata.service: Deactivated successfully.
Sep 29 07:37:58 core1 systemd[1]: Finished coreos-metadata.service - QEMU metadata agent.
```

Signed-off-by: Mathieu Tortuyaux <[email protected]>
  • Loading branch information
tormath1 committed Oct 2, 2023
1 parent dc839de commit e72942e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,22 @@
[Unit]
ConditionKernelCommandLine=|flatcar.oem.id=ec2
ConditionKernelCommandLine=|flatcar.coreos.id=ec2

ConditionKernelCommandLine=|flatcar.oem.id=azure
ConditionKernelCommandLine=|flatcar.coreos.id=azure

ConditionKernelCommandLine=|flatcar.oem.id=digitalocean
ConditionKernelCommandLine=|flatcar.coreos.id=digitalocean

ConditionKernelCommandLine=|flatcar.oem.id=gce
ConditionKernelCommandLine=|flatcar.coreos.id=gce

ConditionKernelCommandLine=|flatcar.oem.id=openstack
ConditionKernelCommandLine=|flatcar.coreos.id=openstack

ConditionKernelCommandLine=|flatcar.oem.id=packet
ConditionKernelCommandLine=|flatcar.coreos.id=packet

Description=Flatcar Metadata Agent

[Service]
Expand Down

0 comments on commit e72942e

Please sign in to comment.