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

init: Set QEMU state dir/PID file path directly #102

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

bjackman
Copy link
Contributor

@bjackman bjackman commented Dec 3, 2024

This fixes #101 for me.

I'm not sure why I didn't used to hit this. I think the actual issue is that /var/local/run is owned by a privilged user and has no global write perms on my host system.

My confidence is not very high that I really understand this system so please review with skepticism :)

@danobi
Copy link
Owner

danobi commented Dec 3, 2024

The error in the linked issue was:

critical: Could not create '/var/local/run/qemu-ga.pid': Permission denied

However, it should have never happened b/c of the dual:

log "Mounting tmpfs at /run"
mount -t tmpfs -o nosuid,nodev tmpfs /run
ln -s /var/run ../run

and

$ qemu-ga -h
<..>
 -f, --pidfile     specify pidfile (default is /var/run/qemu-ga.pid)

Note how the default pidfile location is controlled by vmtest's init.sh.

Seems like your qemu-ga has a different default pidfile location. So I think a more reliable fix would be explicitly specify the pidfile location for qemu-ga. Maybe just pin it to /var/run/qemu-ga.pid here:

qemu-ga --method=virtio-serial --path="$vport" $qga_logs -d

@bjackman
Copy link
Contributor Author

bjackman commented Dec 3, 2024

Ah yeah I tried that before but there's other paths that need to be changed too - however since you think it's a reasonable fix I'll just try fixing those too...

This fixes danobi#101 for me.

I'm not sure why I didn't used to hit this, but on my host system
/var/local/run is owned by a privilged user and has no global write
perms, but is also the default where the qemu-ga build writes these
files to.

Fix is just to set it explicitly to the default that exists on other
systems, which the init script is already set up to handle.
@bjackman
Copy link
Contributor Author

bjackman commented Dec 3, 2024

Cool seems to work, the other paths are all covered by a single arg. The tests fail on my machine (also on master) so let's see if the pass in GHA...

@bjackman
Copy link
Contributor Author

bjackman commented Dec 3, 2024

The tests fail on my machine (also on master)

Just for the record, I had a look into this, issues are:

  1. I didn't notice the Makefile, didn't have the test assets (solution: make test)
  2. The issue this PR fixes.
  3. My distro's OVMF packages seem to be missing certain files. Not gonna look into this now though, I guess it would be fixed if I just installed the ones linked in the README :)

So nothing to fix in vmtest I think.

@danobi danobi changed the title init: Mount tmpfs at /var/local and create run subdir init: Set QEMU state dir/PID file path directly Dec 3, 2024
@danobi danobi merged commit b1c42ff into danobi:master Dec 3, 2024
1 check passed
@danobi
Copy link
Owner

danobi commented Dec 3, 2024

Thanks for taking a look! The CI is not my proudest work :P

Maybe one day we'll make it reliably work locally.

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.

Could not create '/var/local/run/qemu-ga.pid': Permission denied
2 participants