Enable network namespace sharing in lxc-start

Right now lxc-start always does one of two things: it creates
a new namespace or inherits it from the parent environment.
This patch adds a third option: share a namespace with another
container (actually: a process).

In some situations this is handy. For example by sharing a network
namespace it is possible to migrate services between containers
without (or with little) downtime.

This patch creates an infrastructure for inheriting any type
of namespace, but only the network namespace is supported for now.
Allow specifying a container by name or pid in --share-net option.
Cosmetic - clean up error message
Describe --share-net in the lxc-start manual
Cosmetic.
Create --share-ipc option
Merge remote-tracking branch 'lxc/master' into share-namespaces
Fix memory leak in pid_from_lxcname and use ns_proc_name in open_ns.
Refactoring - make the option parsing code generic
Make it possible to share UTS namespace
Cosmetic: shorten the options summary in documentation
Convert all files to utf-8

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
lxc-user-nic: dont risk passing EOF

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxc-user-nic: use common code from network.c

This pulls a lot of common code out of lxc_user_nic.c.  It also
moves one function from conf.c that was duplicated in lxc_user_nic.c
(It removes a DEBUG statement because (a) it doesn't seem actually
useful and (b) DEBUG doesn't work in network.c).

Also replace the old test of only parsing code with a skeleton for
a full test.  (Note - the test will need some work, it's just there
as do-what-i-mean code example)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
Fix stupid architecture error.

From 38cfabdbe0e46f5a0ed20687fcda48424b4a7b6d Mon Sep 17 00:00:00 2001
From: "Michael H. Warfield" <mhw@WittsEnd.com>
Date: Mon, 25 Nov 2013 10:34:48 -0500
Subject: [PATCH 1/2] Fix stupid architecture error.
Organization: Thaumaturgy & Speculums Technology

Fix stupid architecture error.

Stupid error and I did it!  Fixed hard coded x86_64 in several spots.

Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
lxc-fedora: Fixes for selinux and pam_loginuid.so

Just some additional catches for disabling selinux and pam_loginuid.so
thanks to Dwight Engen and the Oracle template.

Also add ssh and ssh-server to the default installation.

Signed-off-by: Michael H. Warfield <mhw@WittsEnd.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
Merge pull request #92 from majek/share-namespaces

Add options to `lxc-start` to inherit network, ipc and uts namespaces
usernsexec: Add missing getline.h include

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>
usernsexec: Include utils.h for unshare

Signed-off-by: Stéphane Graber <stgraber@ubuntu.com>