Fetching command line for a name doesn't work inside Flatpak sandbox
According to D-Feet, the command line for systemd is bwrap --args 18 d-feet
:
No other services show a command line.
This is because Flatpak apps get their own pid namespace, within which they are PID 1:
15:22 $ sudo flatpak enter $(pidof -x /app/bin/d-feet) ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
wjt 1 0.0 0.0 17856 1848 ? S+ 15:18 0:00 bwrap --args 18 d-feet
wjt 2 5.0 0.9 506736 72620 ? Sl+ 15:18 0:13 /usr/bin/python /app/bin/d-feet
wjt 10 0.0 0.0 15000 2420 ? R+ 15:22 0:00 ps aux
Since D-Feet has unconfined access to the session bus, it can run commands on the host, so a cheesy way to fix this would be to replace reading /proc/$PID/cmdline
with spawning flatpak-spawn --host cat /proc/$PID/cmdline
and reading the output.