appjail-cmd
—
Execute commands in a jail
appjail cmd |
all [-e ]
[-i file]
target [args ...] |
appjail cmd |
chroot jail
[command [args ...]] |
appjail cmd |
jaildir [command
[args ...]] |
appjail cmd |
jexec jail
[-l ] [[-U
username|-u
username]] [command
[args ...]] |
appjail cmd |
local jail
[[-j |-r ]]
[command [args ...]] |
The appjail cmd utility executes commands on a
jail or on the host.
all
is used to run the given command in
all existing jails. If -e
is specified,
appjail cmd exits when the command returns a non-zero exit
status. If -i
is specified, the content of the file
specified by this parameter is used as input for each call of the given
command instead of /dev/null.
target is any of the subcommands described below.
chroot
runs the given command in a chroot
environment using the jail directory.
jaildir
is used to execute the given
command from the host in the directory where the jails are located.
jexec
is used to execute the given command
in the given jail. Use the -l
parameter to not run
in a clean environment, or in other words, this is the opposite of the
-l
option specified in
jexec(8).
For a more detailed description of the -U
and
-u
parameters, see
jexec(8).
local
is used to execute the given command
from the host. If -j
is specified
⟨default⟩ the jail directory is used, but if
-r
is specified, the root directory of the jail is
used.
SHELL
is used as the command to execute if
no command or arguments are specified.
The appjail cmd
utility exits 0 on
success, and >0 if an error occurs. It may fail for one of the
following reasons:
- EX_USAGE:
The command was used incorrectly.
- EX_NOINPUT:
jail cannot be found.
- EX_DATAERR:
- jail is invalid.
- An invalid subcommand was specified.
# appjail jail
list
-j
jtest
STATUS NAME TYPE VERSION PORTS NETWORK_IP4
UP jtest thin 14.0-RELEASE - -
# appjail cmd
chroot
jtest pwd
/
# appjail cmd
jaildir
pwd
/usr/local/appjail/jails
# appjail cmd
jexec
jtest pwd
/root
# appjail cmd
local
jtest pwd
/usr/local/appjail/jails/jtest/jail
# appjail cmd
local
jtest -r
pwd
/usr/local/appjail/jails/jtest