[systemd-devel] Systemd-nspawn -- Canot add interface to container

James Lott james at lottspot.com
Thu Sep 25 17:05:34 PDT 2014


Shame on me for not spending more time trying to figure this out before 
responding. Please ignore my previous sad plea for help, I understand fully 
now exactly what you're saying, and was able to successfully move the phy0 
interface into my container.

At this point, my challenge is going to be coordinating the movement of this 
interface within a service file, so I don't need to do it manually when 
starting the container... but I suppose I can write an ExecStartPost script 
which can manage this.

Thanks again for all your help!

On Thursday 25 September 2014 16:25:02 James Lott wrote:
> Hi Zbyszek,
> 
> Thanks for all your help! This is a new concept to me though, as I have
> never tried to refer to a process inside of a container from outside of the
> container before (I did not realize this was possible). Since specifying
> PID 1 would obviously be referring to the host system's init process, would
> you be willing to give me an example that might help me understand how I
> can specify an in-container PID from the host system? Thanks again for
> taking the time to help me grasp all of this :)
> > On Sep 25, 2014, at 2:10 PM, Zbigniew Jędrzejewski-Szmek 
<zbyszek at in.waw.pl> wrote:
> >> On Thu, Sep 25, 2014 at 10:40:42AM -0700, James Lott wrote:
> >> Hi Mantas,
> >> 
> >> Thanks for the clarification. The first thing I tried actually was using
> >> the PID of the systemd-nspawn instance, like so
> >> 
> >> [root at host01 lanvpn]# ps aux | grep -v grep | grep systemd-nspawn
> >> root       143  0.0  0.3   2884   728 ?        Ss   08:42   0:00
> >> /usr/bin/systemd-nspawn --network-bridge=switch1 -bD /home/proxy -M 0
> >> root      4564  0.7  0.6   2884  1124 pts/3    S+   10:38   0:00 systemd-
> >> nspawn --private-network
> >> [root at host01 lanvpn]# iw phy phy0 set netns 4564
> > 
> > systemd-nspawn is *outside* of the container. You should use the child of
> > systemd-nspawn, i.e. the init process, instead.
> > 
> > Zbyszek
> 
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel



More information about the systemd-devel mailing list