Re: [Lxc-users] lxc-start at boot

2011-06-26 Thread err404
On 26/06/2011 16:46, Mihamina Rakotomandimby wrote:
 Hi all,

 I usually launch my containers with 'sudo lxc-start -nname'.
 The problem with this is the fact it doesn't get my back to a shell
 prompt.
 To have what I want, I have to workarround, with screen or end the
 command line with ''.

 More globally, if the containers configuration files are all stored
 in /etc/lxc/, with the basename same as the container name, How to
 make /etc/lxc/ scanned for '*.conf' file and then all VMs started?

 If it's  necessary, I'm running Debian Squeeze.

may be you can try -d option :

'sudo lxc-start -d -nname'


--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users


Re: [Lxc-users] lxc-start at boot

2011-06-26 Thread Michael H. Warfield
On Sun, 2011-06-26 at 17:46 +0300, Mihamina Rakotomandimby wrote: 
 Hi all,

 I usually launch my containers with 'sudo lxc-start -n name'.
 The problem with this is the fact it doesn't get my back to a shell
 prompt.
 To have what I want, I have to workarround, with screen or end the
 command line with ''.

 More globally, if the containers configuration files are all stored
 in /etc/lxc/, with the basename same as the container name, How to
 make /etc/lxc/ scanned for '*.conf' file and then all VMs started?

 If it's  necessary, I'm running Debian Squeeze.

I've got a fairly complex script I use to fire up containers modeled
largely on the OpenVZ model.  The problem here is that you may want
containers to start at boot and ones you DON'T want to start at boot.
You may also have experimental containers you want set up and configured
but will only started if you force them.  You'll also discover that a
little load leveling helps if you think you are going to fire up 3
dozen VM's all at once.  You'll find out rapidly that it's not a good
idea to just start everything blindly for a number of reasons.

I have some parameters I add to the configuration files (commented out
if running stock code) like this:

lxc-boot.onboot = yes
lxc-boot.disabled = no

These correspond directly with the equivalent OpenVZ features.

Then I have a script (which still needs a lot of cleanup) which will go
through all the configuration files and start VM's.  If it's started
with a -b option (boot time) it will only start VM's that are set to:

.onboot = yes.

If you run it manually, you can start one or more VM's but only if they
are NOT disabled.  A -f option will force firing up disabled VM's but
only one at a time.

When it starts a container, it dumps the output to a log file and forks
it off as it's own process.

The script use to use the iowait trick to restart containers and, now
that's part of the base binaries, that's what needs cleaning up now.
But this is all high level management stuff that needs to be looked at
and decided upon.

Maybe, one of these days, I'll finish cleaning it up and send it to
Daniel.


Regards,
Mike
-- 
Michael H. Warfield (AI4NB) | (770) 985-6132 |  m...@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!


signature.asc
Description: This is a digitally signed message part
--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2___
Lxc-users mailing list
Lxc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-users