termux / proot

An chroot-like implementation using ptrace.
https://wiki.termux.com/wiki/PRoot
Other
742 stars 162 forks source link

[Feature]: create a PID namespace #255

Open babaric-dev opened 1 year ago

babaric-dev commented 1 year ago

Can we have PID 1 using PID namespace? unshare() does it but requires root.

michalbednarski commented 1 year ago

I guess I could implrmrny emulated PID namespace in proot by registering first process as subreaper and overriding getpid() (and then also getppid()/kill()/getpgid() ? Besides first process (fake pid 1) other pids would remain same; pid 1 could only be launched through proot command line)

Though the question is what you're trying to achieve, I'd guess pidns wouldn't be sufficient to run systemd