sudo poweroff -n within a container just hangs

Bug #820715 reported by Robert Collins
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Thats about it really it seems to just sit there doing nada.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Confirmed. Marking low priority because there is a workaround (lxc-stop).

Note also that trimmed containers (created with '-- -x') do shut down.

Changed in lxc (Ubuntu):
importance: Undecided → Medium
status: New → Confirmed
importance: Medium → Low
Changed in lxc (Ubuntu):
importance: Low → Medium
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

This doesn't happen with an oneiric container, nor with a trimmed lucid container.

The difference between the two is /etc/init/ssh.conf. In lucid it has
 'stop on runlevel S'

In oneiric it is 'stop on runlevel [!2345]', and trimming a container (with the '-x' option to lxc-create) does the same thing.

I'm going to momentarily assign this to Clint so he can verify for me that there is no way we would SRU a patch for ssh in lucid to change its 'stop on'.

Assuming he confirms that, we'll have to find a clever way for lxcguest to force ssh to stop anyway.

Changed in lxc (Ubuntu):
assignee: nobody → Clint Byrum (clint-fewbar)
Revision history for this message
xlyz (xlyz) wrote :

any news on this?

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

@Clint,

is the suggestion in comment #2 workable?

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

The ssh.conf from lucid-updates has this fixed already:

stop on runlevel [!2345]

openssh (1:5.3p1-3ubuntu6) lucid-proposed; urgency=low

  * Stop Upstart job on runlevel [!2345] rather than just S, since
    /etc/init.d/sendsigs no longer kills jobs under Upstart's control
    (thanks, Rob Donovan; LP: #603363).

 -- Clint Byrum <email address hidden> Sat, 12 Feb 2011 08:38:43 -0800

So if containers aren't getting their packages from -updates.. that is most likely the issue.

Changed in lxc (Ubuntu):
assignee: Clint Byrum (clint-fewbar) → nobody
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Ah! Thanks, Clint. So then this is actually due to the bug in debootstrap that prevents it from using -updates.

I'm going to mark this bug Fix Released as it is unrelated at this point to lxc (or ssh for that matter).

I'm open to suggestions for the best way to handle this. Documentation (i.e. "after creating a lucid container, you need to enable -updates and update") someplace seems best, but where?

Changed in lxc (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Serge, do you have the bug # for debootstrap?

Revision history for this message
xlyz (xlyz) wrote :

why not in lxc-ubuntu template?

appending update repo to source-list, then updating (it's already doing that anyway to install lxcguest) and upgrading openssh.

my 2c.

Revision history for this message
xlyz (xlyz) wrote :

enabling lucid-updates in a lucid container, updating and upgrading throw errors with udev, dmsetup and plymouth:

Processing triggers for ureadahead ...
Setting up udev (151-12.3) ...
mknod: `/lib/udev/devices/ppp': Operation not permitted
dpkg: error processing udev (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of dmsetup:
 dmsetup depends on udev (>> 141-2); however:
  Package udev is not configured yet.
dpkg: error processing dmsetup (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of plymouth:
 plymouth depends on udev (>= 149-2); however:
  Package udev is not configured yet.
dpkg: error processing plymouth (--configure):
 dependency problems - leaving unconfigured

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

@Clint,

hmm, no I don't remember and can't find it. cjwatson may remember.

@xlyz,

you'll need to at least allow the containers to have mknod in the container for udev to succeed. (You can do that using the container's config file). But I was actually suggesting just doing the upgrade in a chroot as part of initial setup.

It should be possible to automate this as a part of the ubuntu template. Please feel free to open a bug against lxc to make that happen.

Revision history for this message
xlyz (xlyz) wrote :

@serge: udev and coreutils are already installed in default lucid container.

if I add updates repo and just install openshh-server everything is fine.

if I try to full-upgrade, or just try to install udev from lucid-updates it throw

Setting up udev (151-12.3) ...
mknod: `/lib/udev/devices/ppp': Operation not permitted
dpkg: error processing udev (--configure):
 subprocess installed post-installation script returned error exit status 1

the other two packages have just udev as dependency.

Revision history for this message
xlyz (xlyz) wrote :
Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 820715] Re: sudo poweroff -n within a container just hangs

Quoting xlyz (<email address hidden>):
> @serge: udev and coreutils are already installed in default lucid container.

Of course, but they fail to upgrade because they expect mknod. As I was
saying, and as the blog you reference shows, you can let the upgrade succeed
by adding mknod to the devices access whitelist.

> if I add updates repo and just install openshh-server everything is
> fine.

Ok, good.

> if I try to full-upgrade, or just try to install udev from lucid-
> updates it throw
>
> Setting up udev (151-12.3) ...
> mknod: `/lib/udev/devices/ppp': Operation not permitted

yes.

> dpkg: error processing udev (--configure):
> subprocess installed post-installation script returned error exit status 1
>
> the other two packages have just udev as dependency.

yes.

As I say it should be possible to update the lxc-ubuntu template to
create 'lucid-updates' (etc) caches and containers, so that you don't
have to mess with this at all.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.