lxc script non-root errors can be confusing

Bug #925520 reported by Gary Poster
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
Fix Released
Low
Unassigned

Bug Description

A trivial thing, but at least a couple of people have been confused by something like this, just being forgetful:

$ lxc-start -n lp
lxc-start: failed to cap_get_flag: Invalid argument
lxc-start: failed to create veth5HNAcN-vethyuiOEf : Operation not permitted
lxc-start: failed to create netdev
lxc-start: failed to create the network
lxc-start: failed to spawn 'lp'
lxc-start: No such file or directory - failed to remove cgroup '/sys/fs/cgroup/cpuset//lxc/lp'

The fix is to simply use sudo. The error message does not communicate this clearly.

I'd suggest that the lxc scripts that need to be run as root (is that all of them except lxc-list?) have a "this script must be run as root" error message, or similar. It's a small thing, but I think it would be appreciated by users.

Revision history for this message
Gary Poster (gary) wrote :

This seems related, but not identical, to bug 918327

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

Thanks for opening this bug. Yes, it'd be helpful to have a check early on for the required capabilities.

Changed in lxc (Ubuntu):
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lxc - 0.7.5-3ubuntu17

---------------
lxc (0.7.5-3ubuntu17) precise; urgency=low

  [ Serge Hallyn ]
  * 0032-start-check-caps.patch: exit early and with a clear error message
    if lxc-start is run with insufficient permissions. (LP: #925520)
  * debian/lxc.init: if there is a failure during lxc network setup, clean
    up and exit. (LP: #925511)

  [ Stéphane Graber ]
  * 0033-ubuntu-template-multiarch.patch: Add support for building
    containers using qemu-user-static, using multi-arch to install some
    packages of the host architecture so the container boots and works.
  * Add qemu-user-static as a Suggest of lxc.
 -- Stephane Graber <email address hidden> Thu, 02 Feb 2012 19:06:19 -0500

Changed in lxc (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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