[Bug 1765699] Re: lxd fails to start main process, yet waitready doesn't bail out

2018-05-02 Thread Free Ekanayaka
Regarding systemd-specific logic, AFAICT we already have some systemd- specific code for socket activation (see lxd/util/http.go:GetListeners). I think that conditionally leveraging what systemd offers (in case LXD is managed by systemd), wouldn't be a bad idea, and the strategy proposed by Dimitr

[Bug 1765699] Re: lxd fails to start main process, yet waitready doesn't bail out

2018-05-02 Thread Free Ekanayaka
It seems that the "failed to open cluster database" error is related to: https://github.com/lxc/lxd/issues/4485 which should be fixed by: https://github.com/lxc/lxd/pull/4518 Issue #4485 also contains some info about how to get you unstuck right now, but you'll want to upgrade to a LXD binary t

[Bug 1765699] Re: lxd fails to start main process, yet waitready doesn't bail out

2018-04-20 Thread Stéphane Graber
The DB upgrade issue is something we've fixed but needs manual intervention if the user ran into it when installing one of our betas. I've helped xnox get back online on IRC by restoring a DB backup and then re-importing some missing containers. This allowed getting back online with all containers

[Bug 1765699] Re: lxd fails to start main process, yet waitready doesn't bail out

2018-04-20 Thread Dimitri John Ledkov
Start-Date: 2018-04-03 22:22:21 Commandline: apt full-upgrade Requested-By: xnox (1000) ... lxc:amd64 (3.0.0~beta3-0ubuntu1, 3.0.0-0ubuntu2), lxd:amd64 (3.0.0~beta5-0ubuntu2, 3.0.0-0ubuntu1), ... Meanwhile > Apr 04 09:45:04 sochi lxd[27714]: Error: failed to open > cluster database: failed to ens

[Bug 1765699] Re: lxd fails to start main process, yet waitready doesn't bail out

2018-04-20 Thread Stéphane Graber
We don't want systemd logic inside LXD itself. If there's a way to tell systemd in its unit to kill any PostStart tasks when the main process exits non-zero, then we'd definitely add that to the unit. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscrib

[Bug 1765699] Re: lxd fails to start main process, yet waitready doesn't bail out

2018-04-20 Thread Dimitri John Ledkov
In the environment, INVOCATION_ID= will be set, when the process is executed under an invocation of a systemd unit. (This can also be reliably verified from the process keyring). When that is set, waitready, can check if said invocation _id is present on the current system's systemd by talking to /

[Bug 1765699] Re: lxd fails to start main process, yet waitready doesn't bail out

2018-04-20 Thread Stéphane Graber
LXD itself doesn't interact with systemd, so I'm not sure how waitready would know that the main systemd unit failed. What waitready does is attempt to talk to the LXD API (which will be blocking due to lxd's socket activation), calling an internal REST API endpoint to wait for LXD's early initial