[lxc-users] LXC auto start not working

Stéphane Graber stgraber at ubuntu.com
Mon Jun 9 14:55:32 UTC 2014


On Mon, Jun 09, 2014 at 10:36:57AM -0400, Michael H. Warfield wrote:
> Stéphane,
> 
> On Mon, 2014-06-09 at 10:12 -0400, Stéphane Graber wrote:
> > On Mon, Jun 09, 2014 at 10:07:05AM -0400, Shidan wrote:
> > > I now am trying to get an unprivilaged container to auto-start, I put the
> > > following in ~/.config/lxc/default.conf:
> > > 
> > > lxc.start.auto = 1
> > > lxc.start.delay = 5
> > > 
> > > 
> > > I also tried putting it in the main /etc/lxc/default.conf file. For both
> > > cases it doesn't work and lxc-ls --fancy shows the autostart flag as NO.
> 
> > For this to work, you need something to call "lxc-autostart" at session
> > open time. For privileged containers we have an init script doing that,
> > but for unprivileged users, there's no single way of doing it and it's
> > hard to know exactly what the user would want to see happen (have all
> > user containers started at boot time and exit at shutdown time or have
> > that happen at user session open time but then what about ssh sessions,
> > ...).
> 
> I think there's also a problem in the way lxc-autostart is handling the
> -P option(s) that would complicate this for user based containers
> outside of the global lxcpath.  See my message over in the -devel list.

Only supporting a single -P wouldn't be a problem if lxc-autostart was
to be run as the user in question, which it ought to be anyway as you
don't want user-owned unprivileged containers to be spawned by root
anyway.

Though I believe the real answer for auto-start of non-root unprivileged
containers is to have the user make sure "lxc-autostart" is called
whenever they want them started and "lxc-autostart -a -A -s" is called
whenever they should be stopped.
Both those calls are to be done as the user and so will use the default
lxc path for that user (either ~/.local/share/lxc or whatever is
specified in ~/.config/lxc/lxc.conf).

> 
> Mike
> -- 
> Michael H. Warfield (AI4NB) | (770) 978-7061 |  mhw at WittsEnd.com
>    /\/\|=mhw=|\/\/          | (678) 463-0932 |  http://www.wittsend.com/mhw/
>    NIC whois: MHW9          | An optimist believes we live in the best of all
>  PGP Key: 0x674627FF        | possible worlds.  A pessimist is sure of it!
> 



> _______________________________________________
> lxc-users mailing list
> lxc-users at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-users


-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20140609/a669a64a/attachment-0001.sig>


More information about the lxc-users mailing list