Re: [PATCH] kvmtool: don't rely on $HOME

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 18 September 2015 at 09:59, Vasiliy Tolstov <v.tolstov@xxxxxxxxx> wrote:
> 2015-09-17 18:53 GMT+03:00 Will Deacon <will.deacon@xxxxxxx>:
>>
>> On Thu, Sep 17, 2015 at 03:03:15PM +0100, Alban Crequy wrote:
>> > kvm__set_dir() called in main() and kvm__get_dir() rely on $HOME. But in
>> > some environments (such as starting lkvm through systemd-run), $HOME is
>> > undefined. This causes bind() to use a socket path containing "(null)"
>> > and this fails. The current code does not check errors returned by
>> > realpath().
>> >
>> > Symptoms:
>> >
>> > | bind: No such file or directory
>> > |   Error: Failed adding socket to epoll
>> > |  Warning: Failed init: kvm_ipc__init
>> > |
>> > |  Fatal: Initialisation failed
>> >
>> > This bug was first reported on https://github.com/coreos/rkt/issues/1393
>> >
>
>
> Why not pass HOME via systemd unit for example to
> Environment=HOME=/var/lib/lkvm ?

We can also use "systemd-run --uid=0" (or "User=root" in the .service
file) and systemd will automatically set the $HOME variable.

But if $HOME is mandatory for kvmtool, the error message should be
improved: instead of "bind: No such file or directory", it should say
"error: $HOME is undefined" or something.

On 17 September 2015 at 17:53, Will Deacon <will.deacon@xxxxxxx> wrote:
> Hmm, but that requires lkvm to be run with sufficient privileges to
> write to /var/lib, which I don't think is generally the case. I think we
> have a few options:
>
>   (1) Try /var/lib/lkvm if $HOME is NULL
>   (2) Use an alternative environment variable for the pid prefix
>   (3) Add a --pid command line option for the pidfile
>   (4) ???
>
> Any preferences? What do other projects do?

I don't know what is better.
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux