mirror of
https://github.com/RGBCube/serenity
synced 2025-05-17 18:35:07 +00:00

The Core::System::create_jail function already provided the new jail index as a result, so it was just a matter of using it when calling the LibCore join_jail function to use the new jail.
646 B
646 B
Name
jail-attach - attach a new process to existing jail
Synopsis
$ jail-attach <jail index> <command>
Description
jail-attach
attaches a new process by specifying a command, to an existing jail, with a
specified jail index.
Options
-i
,--jail-index
: Use an already existing jail with its index-n
,--jail-name
: Create a new jail with a provided name
Examples
# Attach the command "ps -ef" to an already existing jail with the index 0
$ jail-attach -i 0 ps -ef
# Attach the command "/bin/Shell" to a new jail with the name "test jail"
$ jail-attach -n "test jail" /bin/Shell