spiegel_podman/pkg/machine
Paul Holzinger fdb736d282
apple virtiofs: fix racy mount setup
One problem on FCOS is that the root directory is immutable, as such in
order to mount arbitrary paths from the host we must make it mutable
again and create these dir on boot in order to be able to mount there.

The current logic was racy as it used one unit for each path and they
all did chattr -i /; mkdir -p $path; chattr -i / and systemd can run
these units in parallel. That means it was possible for another unit to
make / immutable before the unit could do the mkdir. I pointed this out
on the original PR[1] but we never followed up on it...

Now this here changes several things. First have one unit that does the
chattr -i / (immutable-root-off.service), it is hooked into
remote-fs-pre.target which means it is executed before the network
mounts (virtiofs) are done.

Then we have another unit that does chattr +i /
(immutable-root-on.service) which turn the immutable root back on after
remote-fs.target which means all mount are done at this point.

Additionally the automount unit is removed because it does not add any
value for us and it was borken anyway as it used the virtiofs tag as
path so systemd just ignored it.

[1] https://github.com/containers/podman/pull/20612#discussion_r1384846241

Fixes #22569

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2024-06-27 14:24:07 +02:00
..
apple apple virtiofs: fix racy mount setup 2024-06-27 14:24:07 +02:00
applehv Add Rosetta support for Apple Silicon mac 2024-05-17 17:53:28 +09:00
compression Machine decompress.go refactoring follow-up 2024-03-13 00:58:50 +01:00
connection Fix updating connection when SSH port conflict happens 2024-05-14 16:15:56 +01:00
define Add Rosetta support for Apple Silicon mac 2024-05-17 17:53:28 +09:00
e2e Merge pull request #22920 from cgwalters/virtiofsd-machine 2024-06-24 17:58:08 +00:00
env pkg/machine: use fileutils.(Le|E)xists 2024-04-19 09:52:14 +02:00
hyperv Add Rosetta support for Apple Silicon mac 2024-05-17 17:53:28 +09:00
ignition Add Rosetta support for Apple Silicon mac 2024-05-17 17:53:28 +09:00
libkrun Add Rosetta support for Apple Silicon mac 2024-05-17 17:53:28 +09:00
lock pkg/machine: make checkExclusiveActiveVM race free 2024-03-14 11:13:08 +01:00
ocipull Use a defined constant instead of a hard-coded magic value 2024-05-16 15:50:12 -04:00
os Refactor env dir and port functions into new leaf pkgs 2024-03-04 23:54:31 -06:00
ports Refactor env dir and port functions into new leaf pkgs 2024-03-04 23:54:31 -06:00
provider machine/linux: Support virtiofs mounts (retain 9p default) 2024-06-07 10:03:06 -04:00
proxyenv machine: implement http proxy logic for all providers 2024-02-22 11:23:45 +01:00
qemu machine/linux: Switch to virtiofs by default 2024-06-07 10:03:06 -04:00
shim Clean machine pull cache 2024-04-26 12:31:42 -04:00
sockets pkg/machine: use fileutils.(Le|E)xists 2024-04-19 09:52:14 +02:00
stdpull Clean machine pull cache 2024-04-26 12:31:42 -04:00
vmconfigs Add Rosetta support for Apple Silicon mac 2024-05-17 17:53:28 +09:00
wsl pkg/machine/wsl: force terminate wsl instance 2024-06-17 17:52:01 +02:00
cleanup.go Clean up gvproxy if machine start fails 2024-02-27 13:33:43 -06:00
config.go update golangci-lint to v1.59.1 2024-06-10 14:57:45 +02:00
config_test.go Refactor env dir and port functions into new leaf pkgs 2024-03-04 23:54:31 -06:00
fedora_unix.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
fedora_windows.go Fix Lint on Windows and enable the job 2024-02-20 08:06:18 -05:00
gvproxy.go pkg/machine: ignore gvproxy pidfile not exists error 2024-02-22 12:39:20 +01:00
gvproxy_unix.go Move ignition functions into Containerfiles 2024-02-28 16:05:50 -06:00
gvproxy_windows.go Fix Lint on Windows and enable the job 2024-02-20 08:06:18 -05:00
keys.go pkg/machine: use fileutils.(Le|E)xists 2024-04-19 09:52:14 +02:00
machine_common.go Change API socket to be machine name isolated 2024-03-13 13:28:14 -05:00
machine_unix.go Complete WSL implementation, refactor a few areas 2024-02-11 12:58:11 -06:00
machine_unsupported.go chore: delete obsolete // +build lines 2024-01-04 11:53:38 +02:00
machine_windows.go pkg/machine: use fileutils.(Le|E)xists 2024-04-19 09:52:14 +02:00
pull.go Refactor env dir and port functions into new leaf pkgs 2024-03-04 23:54:31 -06:00
qemuprovider.go podman5 machine reconfig 1 2024-02-07 08:17:43 -06:00
ssh.go Use built-in ssh impl for all non-pty operations 2024-03-24 21:25:22 -05:00
ssh_unix.go machine: implement http proxy logic for all providers 2024-02-22 11:23:45 +01:00
ssh_windows.go machine: implement http proxy logic for all providers 2024-02-22 11:23:45 +01:00
update.go Fix some comments 2024-04-13 15:20:19 +08:00
volumes.go machine/linux: Support virtiofs mounts (retain 9p default) 2024-06-07 10:03:06 -04:00