<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Sat, Oct 27, 2018 at 1:56 AM Shea Sullivan <<a href="mailto:sullivanshea@gmail.com">sullivanshea@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
I am trying to set up systemd unit files for a couple of daemons that<br>
need to run within a specific network namespace. Specifically, I have<br>
a namespace called ABC that is tied to the secondary VNIC on my<br>
machine (ens4) while the default namespace is plumbed to the primary<br>
VNIC (ens3). So it looks like this:<br>
<br>
Primary:<br>
# ip link show dev ens3<br>
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc mq state UP<br>
mode DEFAULT group default qlen 1000<br>
<br>
Secondary/ABC namespace:<br>
# ip netns exec ABC ip link show dev ens4<br>
3: ens4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9000 qdisc mq state UP<br>
mode DEFAULT group default qlen 1000<br>
<br>
Since the 2nd VNIC is connected to a different network, I want a few<br>
of my internal services to run _there_ instead of in the default.<br>
<br>
So here's my question:<br>
when I set up my service file, I understand I need to give the path to<br>
the daemon with<br>
ExecStart=<br>
```Unless Type= is oneshot, exactly one command must be given. ```<br>
<br>
What do you suggest if I want to run my command like this:<br>
/bin/nsenter -t {PID} -m -n /usr/bin/squid<br>
<br>
where squid (for example) is the daemon itself; but nsenter allows me<br>
to run it in that namespace?<br>
<br>
Just confused about whether that's technically one command or not...<br></blockquote><div><br></div><div>It is.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
can I still use Type=Simple?</blockquote><div><br></div><div>Usually `nsenter` directly exec()'s the main program. So the correct type remains exactly the same as with plain Squid.</div><div><br></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Mantas Mikulėnas</div></div></div>