Update Useful commands authored by Nikolai.Hartmann's avatar Nikolai.Hartmann
......@@ -13,15 +13,21 @@ journalctl -eu systemd-nspawn@xcache [--since ...]
```
# container commands
run a command in a temporary container using the xcache image (as xrootd user)
get a shell as xrootd user in a new temporary container using the xcache image
```bash
systemd-nspawn --volatile=overlay -M xcache-$(uuidgen) --private-users=655360 -u xrootd -D /var/lib/machines/xcache <command>
systemd-nspawn --register=no -D /var/lib/machines/xcache /bin/bash
```
get a shell (as xrootd user)
`/bin/bash` can also be replaced by an arbitrary command to be run. Pass `-u root` to get a root shell inside the container.
To run an image other than `/var/lib/machines/xcache` additional options have to be passed on the command line since it won't read `/etc/systemd/nspawn/xcache.nspawn` then, e.g.
```bash
systemd-nspawn --volatile=overlay -M xcache-$(uuidgen) --private-users=655360 -u xrootd -D /var/lib/machines/xcache /bin/bash
systemd-nspawn --volatile=overlay --register=no --private-users=655360 -u xrootd -D /var/lib/machines/<some-other-image> <some-command>
```
get a shell in a running container (as root, usually not nescessary)
To get a shell in the **running** xcache container (as root, usually not nescessary)
```
nsenter --target=$(machinectl show --property Leader xcache | sed "s/^Leader=//") --all
```
......
......