mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 05:47:34 +00:00
Userland: Enhance jail-attach utility to support existing and new jails
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.
This commit is contained in:
parent
1adc3530b2
commit
9f571e0dae
2 changed files with 26 additions and 5 deletions
|
@ -13,9 +13,19 @@ $ jail-attach <jail index> <command>
|
|||
`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
|
||||
|
||||
```sh
|
||||
# Attach the command "ps -ef" to a jail with the index 0
|
||||
$ jail-attach 0 ps -ef
|
||||
# Attach the command "ps -ef" to an already existing jail with the index 0
|
||||
$ jail-attach -i 0 ps -ef
|
||||
```
|
||||
|
||||
```sh
|
||||
# Attach the command "/bin/Shell" to a new jail with the name "test jail"
|
||||
$ jail-attach -n "test jail" /bin/Shell
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue