Proposal: add setup_user option or script
Issue #51
new
I'm proposing an option to chroot_setup (or perhaps a separate script) that would prepare a chroot for a particular user by performing the following steps (written in pseudoscript, with $USER being the given user):
mkdir -p $CHROOT_DIR/home/$USER
chown -R $USER $CHROOT_DIR/home/$USER
system -kpieb "CHGUSRPRF USRPRF($USER) HOMEDIR('$CHROOT_DIR/./home/$USER')
cp ~/.profile $CHROOT_DIR/home/$USER
cp ~/.bash_profile $CHROOT_DIR/home/$USER
Assigning to Aaron for vote
Here's a sample of what I've been using. Does a number of defaults. It is done from a
.lst
file. I am split on whether to continue using.lst
for custom stuff like this or to switch to doing.sh
files.Obviously this would require global variables to be passed. (i.e.
chroot_setup -g myuser=AARON -g mydir=/QOpenSys/mychroot1 /QOpenSys/mychroot1 /path/to/add_user.lst
).Another feature I think we should add is to alter the prompt (via PS1 alteration, seen below) to denote whether you're in a chroot or not. Currently I only display the user, machine and current directory.