lkvm: cannot run rkt from systemd-run because $HOME undefined #1393
Comments
When rkt is started via systemd-run, $HOME might not be defined. Symptoms: |bind: No such file or directory | Error: Failed adding socket to epoll | Warning: Failed init: kvm_ipc__init | | Fatal: Initialisation failed Fix rkt#1393
great find! |
Running the lkvm flavor of rkt in systemd does not currently work if $HOME is not defined: see rkt#1393 It should be fixed in lkvm upstream, but meanwhile, mention the workaround in the documentation.
Workaround documented: #1401 Proper solution will be in upstream patch: http://thread.gmane.org/gmane.comp.emulators.kvm.devel/140459 |
I wonder if instead of documenting the workaround, we should add some code in |
You mean just for lkvm? On Fri, Sep 18, 2015 at 10:09 AM, Alban Crequy notifications@github.com
|
Yes, just for lkvm. |
Seems reasonable. On Fri, Sep 18, 2015 at 11:38 AM, Alban Crequy notifications@github.com
|
As for temporary solution - seems very reasonable. |
kvmtool currently does not work when $HOME is not defined. When started by a systemd unit file (or by systemd-run), $HOME is typically undefined, unless "User=" (or resp. "--uid=") is given. Instead of asking users to work around the issue with "User=" or "--uid=", just define that variable in rkt before calling lkvm. This could be removed when this gets fixed in lkvm upstream. Issue described in rkt#1393
kvmtool currently does not work when $HOME is not defined. When started by a systemd unit file (or by systemd-run), $HOME is typically undefined, unless "User=" (or resp. "--uid=") is given. Instead of asking users to work around the issue with "User=" or "--uid=", just define that variable in rkt before calling lkvm. This could be removed when this gets fixed in lkvm upstream. Issue described in rkt#1393
No, this didn't land upstream. But since #1447 is merged, rkt works fine. |
Upstream topic died somewhere around September so #1447 should be treated as solution and not as a workaround. IMO this issue should be closed. |
Ok, closing. For the record, #1447 was merged into v0.9.0. |
The same command executed directly (without systemd-run) works fine. When adding
strace -e bind,open,stat,execve -f -s 512
, it shows:The
(null)
in the socket path comes from kvm-ipc.c#44:The problem is that
kvm__get_dir()
is using$HOME
and that variable is undefined. Moreover, the way lkvm usesrealpath
will make it set the directory to an uninitialized value from the stack:main.c#16
Workaround: define $HOME when using
systemd-run
Alternative workaround: use
--uid=0
, and $HOME will be implicitly defined.The text was updated successfully, but these errors were encountered: