<div dir="ltr">hi:<div><br></div><div>so for finding the pid the solution its (big surprise :D ) using systemd, instead of just executing you systemd-nspawn in bash you start it as a systemd-unit (you can even do this as ephemeral unit with `sytemd-run --unit myspawn.service systemd-nspawn ....bla...`)</div><div><br></div><div>then to get the ip of the nspawn process no need to ps aux you just do `systemctl show -pMainPID myspawn.service`, that will give you the mainpid, and your child you can get it with `pgrep -P`.</div><div><br></div><div>as personal oprinion... i much like `tail -f /dev/null` better than `sleep <big number>` as a wait to "wait for ever"</div><div><br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr">Alvaro Leiva<br></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Jun 23, 2018 at 2:02 PM Nikolaus Rath <<a href="mailto:Nikolaus@rath.org">Nikolaus@rath.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Jun 23 2018, Nikolaus Rath <<a href="mailto:Nikolaus@rath.org" target="_blank">Nikolaus@rath.org</a>> wrote:<br>
> On Jun 23 2018, aleivag <<a href="mailto:aleivag@gmail.com" target="_blank">aleivag@gmail.com</a>> wrote:<br>
>> short answer, yes, `machinectl login` is only suppported for systemd-init ,<br>
>> and `machinectl shell` `systemd-run` will try to talk to the container via<br>
>> dbus, so i dont think you are force to have systemd runing inside the<br>
>> container (i may be wrong) but you do need to have dbus (and its easy to<br>
>> just have systemd).  if you dont need it, you can always use nsenter to<br>
>> access a namespace on your machine<br>
><br>
> Still not working:<br>
[..]<br>
> $ sudo machinectl shell root@iofabric<br>
> [sudo] password for nikratio: <br>
> Failed to get shell PTY: Cannot set property<br>
> StandardInputFileDescriptor, or unknown property.<br>
<br>
So this seems to be caused by systemd in the container being too old,<br>
and is therefore not available here.<br>
<br>
The 'nsenter' approach seems to work so far, but I don't see a generally<br>
applicable way to figure out the right PID. Is there a trick for that?<br>
<br>
(I ran a "sleep <big-unique-numebr>" in the container and grepped "ps<br>
ax" for the number in the host).<br>
<br>
Best,<br>
-Nikolaus<br>
<br>
-- <br>
GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F<br>
<br>
             »Time flies like an arrow, fruit flies like a Banana.«<br>
_______________________________________________<br>
systemd-devel mailing list<br>
<a href="mailto:systemd-devel@lists.freedesktop.org" target="_blank">systemd-devel@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/systemd-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/systemd-devel</a><br>
</blockquote></div>