From 6bab739821044513a14fc5b876267093674f392b Mon Sep 17 00:00:00 2001 From: Jip-Hop <2871973+Jip-Hop@users.noreply.github.com> Date: Tue, 15 Aug 2023 13:58:47 +0200 Subject: [PATCH] Update README.md --- README.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 29e6c1b..689a7ca 100644 --- a/README.md +++ b/README.md @@ -56,21 +56,19 @@ After answering a few questions you should have your first jail up and running! In order to start a jail automatically after TrueNAS boots, run `jlmkr start myjail` as Post Init Script with Type `Command` from the TrueNAS web interface. If you want to automatically install systemd-nspawn if it's not already installed (recommended to keep working after a TrueNAS SCALE update) then you may use a command such as this instead: `/mnt/mypool/jailmaker/jlmkr.py install && jlmkr start myjail`. -## Additional Commands - -### Start Jail +## Start Jail ```shell jlmkr start myjail ``` -### List Jails +## List Jails ```shell jlmkr list ``` -### Edit Jail Config +## Edit Jail Config ```shell jlmkr edit myjail @@ -78,38 +76,40 @@ jlmkr edit myjail Once you've created a jail, it will exist in a directory inside the `jails` dir next to `jlmkr.py`. For example `/mnt/mypool/jailmaker/jails/myjail` if you've named your jail `myjail`. You may edit the jail configuration file, e.g. using the `jlmkr edit myjail` command (which uses the nano text editor). You'll have to stop the jail and start it again with `jlmkr` for these changes to take effect. -### Remove Jail +## Remove Jail ```shell jlmkr remove myjail ``` -For additional commands we can use `machinectl`, `systemctl` and `journalctl` directly. The `jlmkr.py` script does not play a role here. - -### Stop Jail +## Stop Jail ```shell -machinectl stop myjail +jlmkr stop myjail ``` -### Jail Shell +## Jail Shell ```shell -machinectl shell myjail +jlmkr shell myjail ``` -### Jail Status +## Jail Status ```shell -systemctl status jlmkr-myjail +jlmkr status myjail ``` -### Jail Logs +## Jail Logs ```shell -journalctl -u jlmkr-myjail +jlmkr log myjail ``` +## Additional Commands + +Expert users may use the following additional commands to manage jails directly: `machinectl`, `systemd-nspawn`, `systemd-run`, `systemctl` and `journalctl`. The `jlmkr` script uses these commands under the hood and implements a subset of their capabilities. If you use them directly you will bypass any safety checks or configuration done by `jlmkr` and not everything will work in the context of TrueNAS SCALE. + ### Run Command in Jail If you want to run a command inside a jail, for example from a shell script or a CRON job, you may use `systemd-run` with the `--machine` flag. The example below runs the `env` command inside the jail.