[Lxc-users] stopping a container

Michael H. Warfield mhw at WittsEnd.com
Tue Sep 6 22:13:35 UTC 2011


On Tue, 2011-09-06 at 17:34 -0400, Brian K. White wrote: 
> On 9/5/2011 12:34 PM, Michael H. Warfield wrote:
> > On Mon, 2011-09-05 at 09:24 +0200, Papp Tamas wrote:
> >> On 09/05/2011 08:38 AM, Jäkel, Guido wrote:
> >>>> What is the right way to stop a container?
> >>> Dear Papp,
> >>>
> >>> Like with the thread paradigm in computing langugages, the "right"
> >> way is that the thread decides to stop. Therefore your container have
> >> to leave.
> >>>
> >>> Depending on your Linxus flavor inside the container, you e.g. may
> >> send a signal to it's init process to proper shut down. This mechanism
> >> is "historical" intended to be used by an USV poser supply. In the
> >> moment, I'm using an old-style sytem v init and I may just send a
> >> SIGINT to reboot and a SIGPWR to halt it (must be enabled in the
> >> inittab).
> >>>
> >>>
> >>> Another (planned) way is to use lxc-execute, but this is still not
> >> working. Ulli Hornbacher therefore wrote it's own workaround: A little
> >> daemon executes all command pushed in by a command running at the host
> >> -- disregarding to all aspects of security.
> >>>
> >>> If you're running a sshd inside the container -- and in the most
> >> case you will I think -- you may use this (with a deposited key) to
> >> directly send commands to it.
> >>
> >> hi,
> >>
> >> I don't like the ssh way. I think, halting a container automatically
> >> through an ssh connection is a joke, wich should not be used in any
> >> way.
> >
> > Another way that I have used is to send the init process a kill signal.
> > I think it was the "power fail" sig but that should do it.  That
> > definitely worked with the sysv init but I see to recall I had some
> > problem with upstart (and systemd won't currently run in a container
> > anyways - so you can forget that pig).

> That's not another way. That's exactly the way already stated first above.

Oh, yeah, guess it's better I read up and read the entire quoted thread
and not stop at the comment about "ssh".  :-P  My bad.

> -- 
> bkw

Regards,
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-users/attachments/20110906/eb787e88/attachment.pgp>


More information about the lxc-users mailing list