FS#56622 - {arch-install-scripts} arch-chroot doesn't fix /proc after unshare --pid

Attached to Project: Arch Linux
Opened by Yuxuan Shui (yshui) - Thursday, 07 December 2017, 16:45 GMT
Last edited by Dave Reisner (falconindy) - Saturday, 05 January 2019, 16:36 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To Dave Reisner (falconindy)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Trying to interact with PIDs outside the namespace will just fail, while 'ps' still shows those processes.

On the other hand, it's impossible to query information about processes inside the namespace, it's really hard to find the correct PID to, say, kill a process.

Some applications that relies on /proc might also fail.
This task depends upon

Closed by  Dave Reisner (falconindy)
Saturday, 05 January 2019, 16:36 GMT
Reason for closing:  Won't fix
Additional comments about closing:  Not really a supported use case for arch-chroot. Use systemd-nspawn or some other container solution if you need to do things in the chroot other than finish your arch install.
Comment by Dave Reisner (falconindy) - Thursday, 07 December 2017, 18:49 GMT
What are you doing in the chroot that this matters? arch-chroot wasn't meant for long running tasks -- just an easy way of sneaking into the chroot for initial setup. You could just as easily use systemd-nspawn instead, and that probably gives you the feature you're looking for.
Comment by Yuxuan Shui (yshui) - Friday, 08 December 2017, 10:37 GMT
If that's the case, why do we use --pid at all?
Comment by Dave Reisner (falconindy) - Friday, 08 December 2017, 12:22 GMT Comment by Xiao (leonshaw) - Friday, 14 December 2018, 06:34 GMT
To hide parent processes from chroot /proc, we probably need --mount-proc option of unshare. To map pids to parent namespace, look for NSpid in /proc/$pid/status outside.

Loading...