Re: [Lxc-users] How to make a container init DIE after finishing runlevel 0

2010-01-25 Thread Michael H. Warfield
On Mon, 2010-01-25 at 23:19 -0500, Brian K. White wrote: > From lxc-check/lxc-waiton-init: > > # We use to be able to use lxc-ls but it now prints active VM's twice > Only if you ran lxc-create and then lxc-start. Very true and that's been discussed a bit on the -devel list. > If you just run..

Re: [Lxc-users] How to make a container init DIE after finishing runlevel 0

2010-01-25 Thread Brian K. White
From lxc-check/lxc-waiton-init: > # We use to be able to use lxc-ls but it now prints active VM's twice Only if you ran lxc-create and then lxc-start. If you just run... lxc-start -f config -n name ...with no prior lxc-create, then lxc-ls only shows the container name once. Obviously assu

Re: [Lxc-users] How to make a container init DIE after finishing runlevel 0

2010-01-25 Thread Tony Risinger
this is great stuff, thanks for sharing your script and to Daniel for the inotifywait trick; i've gotten it to work in my setup. looking forward to a Just Works (kernel)? solution :-) but this is working splendidly, thanks again. On Mon, Jan 25, 2010 at 7:50 PM, Michael H. Warfield wrote: >

Re: [Lxc-users] How to make a container init DIE after finishing runlevel 0

2010-01-25 Thread Michael H. Warfield
On Tue, 2010-01-26 at 00:42 +0100, Daniel Lezcano wrote: > I trick I just found: > > while $(true); do > inotifywait /var/lib/lxc/debian/rootfs/var/run/utmp; > if [ "$(wc -l /cgroup/debian/tasks | awk '{ print $1 }')" = "1" ]; then > lxc-stop -n debian > fi; > done > This co

Re: [Lxc-users] How to make a container init DIE after finishing runlevel 0

2010-01-25 Thread Michael H. Warfield
On Mon, 2010-01-25 at 20:50 -0500, Michael H. Warfield wrote: > Mui Bien! Gracias! Or... I really should have responded... Merci beaucop. Studying Spanish. Haven't had French since high school (and my Russian is real rusty). But I'm trying... > Attached. > Mike Regards, Mike -- Michael

Re: [Lxc-users] How to make a container init DIE after finishing runlevel 0

2010-01-25 Thread Michael H. Warfield
On Tue, 2010-01-26 at 01:37 +0100, Daniel Lezcano wrote: > Ah, ok didn't know upstart kept using utmp for compatibility. Interesting. Too much depends on that entire stuff. Thou shalt NOT break Posix compliance. Mike -- Michael H. Warfield (AI4NB) | (770) 985-6132 | m...@wittsend.com /\/

Re: [Lxc-users] How to make a container init DIE after finishing runlevel 0

2010-01-25 Thread Michael H. Warfield
On Tue, 2010-01-26 at 01:50 +0100, Daniel Lezcano wrote: > Michael H. Warfield wrote: > > On Tue, 2010-01-26 at 00:42 +0100, Daniel Lezcano wrote: > > > > > >> I trick I just found: > >> > >> while $(true); do > >> inotifywait /var/lib/lxc/debian/rootfs/var/run/utmp; > >> if [ "$(wc -l

Re: [Lxc-users] How to make a container init DIE after finishing runlevel 0

2010-01-25 Thread Michael H. Warfield
On Tue, 2010-01-26 at 00:42 +0100, Daniel Lezcano wrote: > Michael H. Warfield wrote: > > On Mon, 2010-01-25 at 21:50 +0100, Daniel Lezcano wrote: > > > > > >>> apologies for the length, but how is everyone else handling this? > >>> this is the last thing i need to solve before i actually start

Re: [Lxc-users] How to make a container init DIE after finishing runlevel 0

2010-01-25 Thread Michael H. Warfield
On Tue, 2010-01-26 at 00:42 +0100, Daniel Lezcano wrote: > I trick I just found: > > while $(true); do > inotifywait /var/lib/lxc/debian/rootfs/var/run/utmp; > if [ "$(wc -l /cgroup/debian/tasks | awk '{ print $1 }')" = "1" ]; then > lxc-stop -n debian > fi; > done Seems to

Re: [Lxc-users] How to make a container init DIE after finishing runlevel 0

2010-01-25 Thread Daniel Lezcano
Michael H. Warfield wrote: > On Tue, 2010-01-26 at 00:42 +0100, Daniel Lezcano wrote: > > >> I trick I just found: >> >> while $(true); do >> inotifywait /var/lib/lxc/debian/rootfs/var/run/utmp; >> if [ "$(wc -l /cgroup/debian/tasks | awk '{ print $1 }')" = "1" ]; then >> lxc-st

Re: [Lxc-users] How to make a container init DIE after finishing runlevel 0

2010-01-25 Thread Daniel Lezcano
Michael H. Warfield wrote: > On Tue, 2010-01-26 at 00:42 +0100, Daniel Lezcano wrote: > >> Michael H. Warfield wrote: >> >>> On Mon, 2010-01-25 at 21:50 +0100, Daniel Lezcano wrote: >>> >>> >>> > apologies for the length, but how is everyone else handling this? > this is

Re: [Lxc-users] How to make a container init DIE after finishing runlevel 0

2010-01-25 Thread Daniel Lezcano
Michael H. Warfield wrote: > On Mon, 2010-01-25 at 23:39 +0100, Daniel Lezcano wrote: > >> Michael H. Warfield wrote: >> >>> On Mon, 2010-01-25 at 21:50 +0100, Daniel Lezcano wrote: >>> >>> >>> > apologies for the length, but how is everyone else handling this? > this is

Re: [Lxc-users] How to make a container init DIE after finishing runlevel 0

2010-01-25 Thread Daniel Lezcano
Michael H. Warfield wrote: > On Mon, 2010-01-25 at 21:50 +0100, Daniel Lezcano wrote: > > >>> apologies for the length, but how is everyone else handling this? >>> this is the last thing i need to solve before i actually start running >>> all my services on this setup. >>> >>> >> I was

Re: [Lxc-users] How to make a container init DIE after finishing runlevel 0

2010-01-25 Thread Michael H. Warfield
On Mon, 2010-01-25 at 23:39 +0100, Daniel Lezcano wrote: > Michael H. Warfield wrote: > > On Mon, 2010-01-25 at 21:50 +0100, Daniel Lezcano wrote: > > > > > >>> apologies for the length, but how is everyone else handling this? > >>> this is the last thing i need to solve before i actually start

Re: [Lxc-users] How to make a container init DIE after finishing runlevel 0

2010-01-25 Thread Daniel Lezcano
Michael H. Warfield wrote: > On Mon, 2010-01-25 at 21:50 +0100, Daniel Lezcano wrote: > > >>> apologies for the length, but how is everyone else handling this? >>> this is the last thing i need to solve before i actually start running >>> all my services on this setup. >>> >>> >> I was

Re: [Lxc-users] How to make a container init DIE after finishing runlevel 0

2010-01-25 Thread Michael H. Warfield
And here I am replying to myself... Again... :-/ On Mon, 2010-01-25 at 16:18 -0500, Michael H. Warfield wrote: > On Mon, 2010-01-25 at 21:50 +0100, Daniel Lezcano wrote: > > > > apologies for the length, but how is everyone else handling this? > > > this is the last thing i need to solve befor

Re: [Lxc-users] How to make a container init DIE after finishing runlevel 0

2010-01-25 Thread Michael H. Warfield
On Mon, 2010-01-25 at 21:50 +0100, Daniel Lezcano wrote: > > apologies for the length, but how is everyone else handling this? > > this is the last thing i need to solve before i actually start running > > all my services on this setup. > > > I was wondering if the kernel shouldn't send a signa

Re: [Lxc-users] How to make a container init DIE after finishing runlevel 0

2010-01-25 Thread Tony Risinger
ah ok. i think i remember reading that message about the shutdown issues. also in my last message i mixed up SIGINT and SIGPWR; with the inittab im using, SIGPWR to container will enter runlevel 0, and SIGINT will enter runlevel 6 then immediately back to 3 (reboot). i managed to create a workar

Re: [Lxc-users] How to make a container init DIE after finishing runlevel 0

2010-01-25 Thread Daniel Lezcano
Tony Risinger wrote: > hello, > > over the past several weeks i have been working intensively on setting > up my personal servers with LXC based containers. at this point, i am > extremely pleased with my setup, and will soon be sharing all that i > have accomplished in the form of several scripts