[lxc-devel] [lxc/lxc] 31efc3: archlinux template: added sigpwr handling to syste...

Dwight Engen dwight.engen at oracle.com
Wed May 7 22:37:29 UTC 2014


On Wed, 7 May 2014 15:50:00 -0500
Leonid Isaev <lisaev at umail.iu.edu> wrote:

> Hi,
> 
> On Wed, 7 May 2014 13:25:04 -0500
> Stéphane Graber <stgraber at ubuntu.com> wrote:
> 
> > On Wed, May 07, 2014 at 01:11:39PM -0500, Leonid Isaev wrote:
> > > Hi,
> > > 
> > > 	Unless I am missing something, I see multiple issues with
> > > this change:
> > > 
> > > 1. The template still includes lxc.stopsignal=SIGRTMIN+4 in
> > > config which is a proper shutdown signal for systemd (it
> > > triggeres poweroff.target). So at best, the patch is incomplete.
> > > 
> > > 2. The general logic should be that LXC guests receive minimal
> > > modifications relative to bare metal installs. All necessary
> > > tweaks should be done in the config file and via cmdline options
> > > to lxc-stop/start.
> > > 
> > > 3. Symlinking poweroff.target to sigpwr.target is an obscure and
> > > unnecessary hack. The author really should have read systemd
> > > documentation, specifically systemd.special(7).
> > > 
> > > Thanks,
> > > Leonid.
> > 
> > Ok, I believe we had other systemd distros use that trick (Oracle
> > and OpenSUSE), so it may be best to agree on one implementation of
> > that with systemd and go with it.
> 
> You are right: opensuse and oracle do the same thing with the
> sigpwr.target. But I think this is a wrong approach because of (2)
> above. 

I think lxc-fedora has similar. I don't think its wrong per se, given
that man systemd(1) says "When this signal is received the systemd
manager will start the sigpwr.target unit.". But I agree that the fewer
changes we have to do to the rootfs of the container the better. FWIW-I
think we should use lxc.haltsignal, and IIRC that didn't exist at the
time Mike first got fedora containers with systemd working.

> > 
> > So what you're saying is that before this change, clean shutdown
> > using lxc-stop was already working for ArchLinux?
> 
> Yes, with lxc-stop (lxc < 1.0) and lxc-stop -k (since 1.0). This
> change was supposed to be made in archlinux lxc at .service after
> packaging lxc-1.0.0, to not break existing setups (I opened a
> bugreport back in the day), but apparently was forgotten. I guess
> that's what caused the whole story.
> 
> So, this really is a distro bug, not an upstream (lxc) issue... sorry
> for the mess.
> 
> However, if people believe otherwise, IMHO the proper way to fix
> things was to change the default container config, i.e. replace
> "lxc.stopsignal=SIGRTMIN+4" with "lxc.haltsignal=SIGRTMIN+4" in
> copy_configuration() and do not mess with systemd shutdown logic.
> 
> Additionally, containers created by lxc-archlinux worked with
> systemd-nspawn out-of-the-box, but now I'm not sure of it...
> 
> > 
> > If so, I'll just revert the patch.
> 
> If you have the time. Otherwise, I'll send a patch over the weekend
> which reverts this commit and does the above config change as well as
> some trivial clean-ups.
> 
> Thanks,
> L.
> 



More information about the lxc-devel mailing list