User:Maffblaster/Drafts/Schroot

From Gentoo Wiki
Jump to: navigation, search
Resources

schroot is a utility to security enter and execute commands in a chroot environment.

Installation

USE flags

USE flags for dev-util/schroot Utility to execute commands in a chroot environment

btrfs Enable support for chroots using btrfs snapshots. local
dchroot Enables the building of a wrapper named "dchroot", replacing sys-apps/dchroot. local
doc Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally global
lvm Enable support for chroots using LVM snapshots. local

Emerge

root #emerge --ask dev-util/schroot

Configuration

Environment variables

Files

  • /etc/schroot/schroot.conf - Global (system wide) configuration file.
  • /etc/schroot/chroot.d - A directory for additional chroot definitions. See the schroot man page for more details.
  • /etc/schroot/setup.d - The global setup script directory.
  • /etc/pam.d/schroot - A global PAM configuration directory.


Usage

Invocation

user $schroot --help
Usage:
  schroot  [OPTION…] [COMMAND] — run command or shell in a chroot

Actions:
  -h [ --help ]                   Show help options
  -V [ --version ]                Print version information
  -l [ --list ]                   List available chroots
  -i [ --info ]                   Show information about selected chroots
  --config                        Dump configuration of selected chroots
  --location                      Print location of selected chroots

General options:
  -q [ --quiet ]                  Show less output
  -v [ --verbose ]                Show more output

Chroot selection:
  -c [ --chroot ] arg             Use specified chroot
  -a [ --all ]                    Select all chroots and active sessions
  --all-chroots                   Select all chroots
  --all-sessions                  Select all active sessions
  --all-source-chroots            Select all source chroots
  --exclude-aliases               Do not include aliases

Chroot environment:
  -d [ --directory ] arg          Directory to use
  -s [ --shell ] arg              Shell to use as login shell
  -u [ --user ] arg               Username (default current user)
  -p [ --preserve-environment ]   Preserve user environment
  -o [ --option ] arg             Set option

Session actions:
  --automatic-session             Begin, run and end a session automatically
                                  (default)
  -b [ --begin-session ]          Begin a session; returns a session ID
  --recover-session               Recover an existing session
  -r [ --run-session ]            Run an existing session
  -e [ --end-session ]            End an existing session

Session options:
  -n [ --session-name ] arg       Session name (defaults to an automatically
                                  generated name)
  -f [ --force ]                  Force operation, even if it fails

Removal

Unmerge

root #emerge --ask --depclean dev-util/schroot

See also

External resources