[lxc-devel] Configuration question?

Michael H. Warfield mhw at WittsEnd.com
Tue Jan 26 22:12:07 UTC 2010


On Tue, 2010-01-26 at 22:43 +0100, Daniel Lezcano wrote: 
> Michael H. Warfield wrote:
> > On Tue, 2010-01-26 at 21:18 +0100, Daniel Lezcano wrote: 
> >   
> >> Michael H. Warfield wrote:
> >>     
> >>> I'm working on some scripts and I have a configuration question.  Yes I
> >>> could probably read the code and figure out the answers for myself or
> >>> just blindly try it but I figure if I ask here someone could say "no
> >>> don't do that" or "hey that's not a bad idea" before I go charging
> >>> ahead.
> >>>
> >>> Put simply...  Is is possible / permissible to add configuration
> >>> variables to the config file?  I've been converting containers over from
> >>> OpenVZ and there's some odd flags and values I would like to stuff in
> >>> there.  Things like "ONBOOT" and "DESCRIPTION" from the OpenVZ file.  Is
> >>> lxc-start and friends just going to ignore extraneous (to them)
> >>> configuration options or are they going to complain or blow chunks?
> >>>       
> >> It will complain.
> >>
> >>     
> >>> If it's possible, is there a convention you would like followed.  I'm
> >>> thinking along this lines of this for those two examples:
> >>>
> >>> lxc.onboot = yes|no [default no]
> >>> lxc.description = "Arbitrary String"
> >>>
> >>> Yes?  No?  Maybe?  Hell no?
> >>>       
> >
> >   
> >> I am not sure to understand. Can you elaborate a bit ?
> >> Do you want to define some environment variables for the container via 
> >> the lxc configuration file ? Or are these configuration variables 
> >> specific (I don't know OpenVZ except by its name) ?
> >>     
> >
> > OpenVZ supports specifying in their ve config files if a container gets
> > started when the host is booted.  If it's not set, the container won't
> > get started automatically at boot and has to be manually started.  This
> > would be used by a front end startup script.  At boot time, it can check
> > all the containers registered with it and start the ones set to
> > autostart.  OpenVZ also has a "disabled" option where the container is
> > disabled even from manual booting unless "force" is specified but I
> > don't know that I see much use for that.  Description is just a high
> > level description of the container for front ends and user interfaces.
> > The reason I was thinking of putting it in the config file (which I did
> > just try just a little bit ago and lxc-start didn't complain, but maybe
> > it would in a debug print) is that way it would follow the other config
> > variables when the container is created and I could just loop
> > through /var/lib/lxc/*/config to find them.
> >   
> Ok got it, but it's not the right place to put these informations.
> You can simply add a file /var/lib/lxc/*/onboot, this is the purpose of 
> the lxc directory, store any external information in a single place.
> So when you destroy the container, the lxc directory is removed with all 
> the external material added at this place.

Yeah, well, that was kinda one of my other alternatives.  I just wanted
to test the waters with this idea for two reasons.  One, I'm already
reading and parsing the config file and it would be one more file to
process and, two, lxc-create won't automagically copy it over for me,
the way it does the conf file specified to it.  So, I'll go the other
route in that case.  My third choice was a split between the two ideas
where I left them in the conf file but as specially formatted comments.
Yeah, butt ugly hack.  I rejected that idea pretty quickly.  :-P

Thanks!

Mike
-- 
Michael H. Warfield (AI4NB) | (770) 985-6132 |  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!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 482 bytes
Desc: This is a digitally signed message part
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20100126/55fa2ab9/attachment.pgp>


More information about the lxc-devel mailing list