From: Will Deacon <will.deacon@arm.com>
To: Riku Voipio <riku.voipio@linaro.org>
Cc: Alban Crequy <alban.crequy@gmail.com>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH] kvmtool: don't rely on $HOME
Date: Fri, 18 Sep 2015 13:56:19 +0100 [thread overview]
Message-ID: <20150918125619.GC12837@arm.com> (raw)
In-Reply-To: <CAAqcGHm_q1sxRtae4BdYecdTJy+rTWo8i5rdiuPTm_x3hDEtNQ@mail.gmail.com>
On Fri, Sep 18, 2015 at 11:51:37AM +0100, Riku Voipio wrote:
> On 17 September 2015 at 18:53, Will Deacon <will.deacon@arm.com> wrote:
> > 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
> >>
> >> Instead of using "$HOME/.lkvm/" (i.e. "/root/.lkvm/"), this patch uses
> >> "/var/lib/lkvm/". This also improve the error reporting by printing the
> >> socket filename.
> >
> > 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?
>
> The right place to put a pid file would be $XDG_RUNTIME_DIR aka
> /run/user/$UID/. System services write their pidfiles and sockets to
> plain /run
Ok, that certainly sounds like the right things to do for temporary
structures then. Thanks.
> The place where to put the rootfs structure created in builtin-setup.c
> is more complicated. Is the created rootfs epheremal? Then sticking
> under /run(user/UID) is fine.
Currently, the filesystem persists across multiple invocations of lkvm,
so I can imagine somebody being surprised if what they thought was
persistent was lost over something like a reboot.
Will
next prev parent reply other threads:[~2015-09-18 12:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-17 14:03 [PATCH] kvmtool: don't rely on $HOME Alban Crequy
2015-09-17 15:53 ` Will Deacon
2015-09-18 7:59 ` Vasiliy Tolstov
2015-09-18 9:45 ` Alban Crequy
2015-09-18 10:51 ` Riku Voipio
2015-09-18 12:56 ` Will Deacon [this message]
2015-09-18 16:04 ` Dimitri John Ledkov
2015-09-18 9:43 ` Dimitri John Ledkov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150918125619.GC12837@arm.com \
--to=will.deacon@arm.com \
--cc=alban.crequy@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=riku.voipio@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.