lxc-start-ephemeral: Use attach
lxc-start-ephemeral: Use attach

With this change, systems that support it will use attach to run any
provided command.

This doesn't change the default behaviour of attaching to tty1, but it
does make it much easier to script or even get a quick shell with:
lxc-start-ephemeral -o p1 -n p2 -- /bin/bash

I'm doing the setgid,initgroups,setuid,setenv magic in python rather
than using the attach_wait parameters as I need access to the pwd module
in the target namespace to grab the required information.

Signed-off-by: Stéphane Graber <089afc6d81f66f1168a9849e15660feae286e024@ubuntu.com>
Acked-by: Serge E. Hallyn <3df611b026e4639bee8aef7a4beb2e39fcebb313@ubuntu.com>

jirislaby/lxc,yubo/lxc,thmo/lxc,bostjan/lxc,hallyn/lxc,sapun/lxc,Distrotech/lxc,QingweiPeterLan/cs188-lxc,raspberrypython/lxc,ojkastl/lxc_Patches,weizhenwei/lxc,ss1h2a3tw/lxc,akshaykarle/lxc,major/lxc,christiaan/lxc,rldleblanc/lxc,regit/lxc,LynxChaus/lxc,sapun/lxc,efiop/lxc,federicobriata/lxc,Distrotech/lxc,ojkastl/lxc_Patches,lazy404/lxc,christiaan/lxc,DarknessBeforeDawn/lxc,terceiro/lxc,szaszg/lxc,bostjan/lxc,lazy404/lxc,christiaan/lxc,rldleblanc/lxc,thmo/lxc,ojkastl/lxc_Patches,codebauss/lxc,ecarrara/lxc,JohnPeacockMessageSystems/lxc,hkjolhede/lxc,bmoar/lxc,Ponce/lxc,cjwatson/lxc,ioops/lxc,akshaykarle/lxc,ysbnim/lxc,JohnPeacockMessageSystems/lxc,federicobriata/lxc,QingweiPeterLan/cs188-lxc,ksperis/lxc,bmoar/lxc,GreatFruitOmsk/lxc,cjwatson/lxc,tych0/lxc,terceiro/lxc,tych0/lxc,efiop/lxc,rowhit/lxc,lazy404/lxc,raspberrypython/lxc,szaszg/lxc,aeris/lxc,rowhit/lxc,raspberrypython/lxc,fwilson42/lxc,ioops/lxc,armcc/lxc,ksperis/lxc,tych0/lxc,virajs/lxc,ksperis/lxc,lisongmin/lxc,armcc/lxc,armcc/lxc,ojkastl/lxc_Patches,caglar10ur/lxc,Ponce/lxc,weizhenwei/lxc,akshaykarle/lxc,ecarrara/lxc,hkjolhede/lxc,ioops/lxc,DarknessBeforeDawn/lxc,cjwatson/lxc,JohnPeacockMessageSystems/lxc,bostjan/lxc,bmoar/lxc,Ponce/lxc,LynxChaus/lxc,caglar10ur/lxc,GreatFruitOmsk/lxc,codebauss/lxc,QingweiPeterLan/cs188-lxc,yubo/lxc,ss1h2a3tw/lxc,weizhenwei/lxc,sapun/lxc,Pelagicore/lxc,ecarrara/lxc,ss1h2a3tw/lxc,ysbnim/lxc,rowhit/lxc,hallyn/lxc,hallyn/lxc,DarknessBeforeDawn/lxc,lisongmin/lxc,virajs/lxc,virajs/lxc,caglar10ur/lxc,yubo/lxc,major/lxc,hkjolhede/lxc,jirislaby/lxc,hfuCN/lxc,federicobriata/lxc,szaszg/lxc,thmo/lxc,Pelagicore/lxc,GreatFruitOmsk/lxc,regit/lxc,fwilson42/lxc,ysbnim/lxc,jirislaby/lxc,major/lxc,terceiro/lxc,fwilson42/lxc,aeris/lxc,rldleblanc/lxc,LynxChaus/lxc,regit/lxc,Pelagicore/lxc,codebauss/lxc,hfuCN/lxc,lisongmin/lxc,Distrotech/lxc,efiop/lxc,hfuCN/lxc,aeris/lxc