From e21ddefdbf64813467bf2790e805d40448888c4f Mon Sep 17 00:00:00 2001 From: CyberLeo Date: Wed, 4 May 2011 03:15:25 -0500 Subject: [PATCH] j: do not use 'jail' since these are chroots, not true jails --- j | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/j b/j index 5e9af8e..537aaa6 100755 --- a/j +++ b/j @@ -36,7 +36,7 @@ jbase="${J_BASE:-$(realpath "$(dirname "${0}")/../")}" jname="${J_NAME:-$(basename "${1}")}" #" juser="${J_USER}" -# Remove jail name from argument stack, if passed in +# Remove chroot name from argument stack, if passed in [ "${J_NAME}" ] || shift # Propagate certain environment variables; sterilize the rest of the environment @@ -56,11 +56,11 @@ j_ls() { # Create a new chroot, somehow j_init() { - # Either a debian jail with debootstrap or a gentoo jail with stage3 + portage tarballs + # Either a debian chroot with debootstrap or a gentoo chroot with stage3 + portage tarballs DEBOOTSTRAP_DIR="$(base)/debootstrap" "${DEBOOTSTRAP_DIR}/debootstrap" --arch=amd64 squeeze "${jdir}" } -# Figure out and set jail parameters; needed for all functions that follow +# Figure out and set chroot parameters; needed for all functions that follow j_params() { ( jname="${1:-jname}" @@ -71,7 +71,7 @@ j_params() { return 1 fi - # Given a jail name, find and set up the jail dir + # Given a chroot name, find and set up the chroot dir jdir="${jbase}/${jname}" if [ ! -d "${jdir}" ] then @@ -98,7 +98,7 @@ j_params() { ) } -# Jail is 'up' if /dev/pts and /proc are mounted +# Chroot is 'up' if /dev/pts and /proc are mounted j_up() { jname="${1:-${jname}}" eval "$(j_params "${jname}")" @@ -122,7 +122,7 @@ j_start() { jname="${1:-${jname}}" j_up "${jname}" && return 0 eval "$(j_params "${jname}")" - meh "starting ${jail} ..." + meh "starting ${jname} ..." mount -t devpts devpts "${jdir}/dev/pts" mount -t proc proc "${jdir}/proc" } @@ -130,7 +130,7 @@ j_start() { # Execute command in chroot j_eval() { jname="${1:-${jname}}" - j_up "${jname}" || wtf "jail not up" + j_up "${jname}" || wtf "chroot not running" eval "$(j_params "${jname}")" shift env -i ${jenv} /usr/bin/chroot "${jdir}" /bin/su "${juser:-${USER}}" -c "${*}" @@ -147,7 +147,7 @@ j_stop() { jname="${1:-${jname}}" eval "$(j_params "${jname}")" j_up "${jname}" || return 0 - meh "stopping ${jail} ..." + meh "stopping ${jname} ..." umount "${jdir}/proc" umount "${jdir}/dev/pts" } -- 2.42.0