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

units: Workaround for user-configvirtfs.service #24

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

pothos
Copy link
Member

@pothos pothos commented Sep 21, 2023

As Jeremi noticed with the current Flatcar Stable 3510.2.7 and a custom Docker brought in as systemd-sysext image, the qemu VM didn't pick up the SSH keys anymore. This couldn't be reproduced with Alpha, though. The culprit is not completely known but it seems to be a race condition that makes the Wants= dependency of media-configvirtfs.mount not take action.
To work around the problem, use Upholds= which eventually starts user-configvirtfs.service.

How to use

Backport to Stable

Testing done

With the change as drop-in, one can login via SSH:

variant: flatcar
version: 1.0.0
storage:
  files:
    - path: /opt/extensions/docker/docker-24.0.5-x86-64.raw
      contents:
        source: https://github.com/flatcar/sysext-bakery/releases/download/20230901/docker-24.0.5-x86-64.raw
    - path: /etc/systemd/system-generators/torcx-generator
    - path: /etc/sysupdate.d/noop.conf
      contents:
        source: https://github.com/flatcar/sysext-bakery/releases/download/20230901/noop.conf
    - path: /etc/sysupdate.docker.d/docker.conf
      contents:
        source: https://github.com/flatcar/sysext-bakery/releases/download/20230901/docker.conf
  links:
    - target: /opt/extensions/docker/docker-24.0.5-x86-64.raw
      path: /etc/extensions/docker.raw
      hard: false
    - path: /etc/extensions/docker-flatcar.raw
      target: /dev/null
      overwrite: true
    - path: /etc/extensions/containerd-flatcar.raw
      target: /dev/null
      overwrite: true
systemd:
  units:
    - name: systemd-sysupdate.timer
      enabled: true
    - name: systemd-sysupdate.service
      dropins:
        - name: docker.conf
          contents: |
            [Service]
            ExecStartPre=/usr/lib/systemd/systemd-sysupdate -C docker update
        - name: sysext.conf
          contents: |
            [Service]
            ExecStartPost=systemctl restart systemd-sysext
    - name: media-configvirtfs.mount
      dropins:
        - name: upholds.conf
          contents: |
            [Unit]
            Upholds=user-configvirtfs.service

As Jeremi noticed with the current Flatcar Stable 3510.2.7 and a custom
Docker brought in as systemd-sysext image, the qemu VM didn't pick up
the SSH keys anymore. This couldn't be reproduced with Alpha, though.
The culprit is not completely known but it seems to be a race condition
that makes the Wants= dependency of media-configvirtfs.mount not take
action.
To work around the problem, use Upholds= which eventually starts
user-configvirtfs.service.
@pothos pothos requested a review from a team September 21, 2023 11:52
@pothos pothos merged commit 47bc4cf into flatcar-master Sep 21, 2023
1 check passed
@pothos pothos deleted the kai/vm-userdata branch September 21, 2023 13:47
pothos added a commit to flatcar/scripts that referenced this pull request Sep 21, 2023
This pulls in
flatcar/coreos-cloudinit#24
as a workaround to use Upholds= which eventually starts
user-configvirtfs.service.
pothos added a commit to flatcar/scripts that referenced this pull request Sep 21, 2023
This pulls in
flatcar/coreos-cloudinit#24
as a workaround to use Upholds= which eventually starts
user-configvirtfs.service.
pothos added a commit to flatcar/scripts that referenced this pull request Sep 21, 2023
This pulls in
flatcar/coreos-cloudinit#24
as a workaround to use Upholds= which eventually starts
user-configvirtfs.service.
pothos added a commit to flatcar/scripts that referenced this pull request Sep 21, 2023
This pulls in
flatcar/coreos-cloudinit#24
as a workaround to use Upholds= which eventually starts
user-configvirtfs.service.
pothos added a commit to flatcar/scripts that referenced this pull request Sep 21, 2023
This pulls in
flatcar/coreos-cloudinit#24
as a workaround to use Upholds= which eventually starts
user-configvirtfs.service.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants