Comment

Comment by throw0101c

> Can jails be used to run subprocesses in the normal filesystem, but with a different network environment (for example making a given command run its net traffic through TAP)?

Jails are basically like a VM-like/light: it appears like jail is its own system. Not quite as heavy as an actual VM under (e.g.) Qemu with virtualized hardware. A jail can have its own network stack:

* https://klarasystems.com/articles/virtualize-your-network-on...

You can then create a 'virtual patch cable' between the host and the jail and send one side of the 'cable' to the jail and do routing and stuff on the host:

* https://man.freebsd.org/cgi/man.cgi?epair

But a (sub)process cannot be 'sent' to a jail: jails 'boot up' like a normal system does, and so you'd have your PID 1 run your regular daemon startup.

> Can jails be used to limit memory/cpu/IO/network for subprocesses? For threads within a process?

Yes:

* https://wiki.freebsd.org/JailResourceLimits

> Can live processes be moved into or out of a jail?

No: jails are VM-like in functionality.

> Can jails be used to make a process think it's running as a different user?

The jail, being VM-like, would have its own passwd.

parent throw0101c 3 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton