mrrl-containers

MRRL version of container scripts
git clone https://ccx.te2000.cz/git/mrrl-containers
Log | Files | Refs

commit b491fd9f47b65b5fad91bfebc790a8be24a75b9a
parent e917297166dd2362fa066f4653421a23dfa61715
Author: Jan Pobrislo <ccx@webprojekty.cz>
Date:   Wed, 12 Oct 2022 16:32:33 +0200

Add optional homedir/container-setup script
Diffstat:
Mservice_scripts/generic/run | 15++++++++++-----
Mservice_scripts/xsession/run | 2+-
2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/service_scripts/generic/run b/service_scripts/generic/run @@ -30,17 +30,22 @@ if { chmod 1770 ${CONTAINER_TMPFS}/${tmpfs_dirs} } if { chown root:${CONTAINER_USER} ${CONTAINER_TMPFS}/${tmpfs_dirs} } if { mount -a --fstab data/fstab } -# Put UID/GID of user and their exclusive group (same group name as user name) -#s6-envuidgid -B ${CONTAINER_USER}:${CONTAINER_USER} +# Put UID/GID/GIDLIST into environment for use by s6-applyuidgid below +s6-envuidgid ${CONTAINER_USER} + +# Run user's setup script (optional) +if { + if -n -t { s6-test -e ${CONTAINER_USER_HOME}/container-setup } + env HOME=${CONTAINER_USER_HOME} + s6-applyuidgid -U + ${CONTAINER_USER_HOME}/container-setup ${CONTAINER_TMPFS} ${CONTAINER_NAME} +} -#multisubstitute { importas -i UID UID importas -i GID GID } env HOST=${CONTAINER_NAME} #RUN_CHOWN=${UID}:${GID} NS_EXTRA="if { mount -o bind,ro /etc/passwd etc/passwd } if { mount -o bind,ro /etc/group etc/group }" -# Put UID/GID/GIDLIST into environment for use by s6-applyuidgid below -s6-envuidgid ${CONTAINER_USER} emptyenv -c ns_run data/root /mnt/ns/bin/s6-applyuidgid -U diff --git a/service_scripts/xsession/run b/service_scripts/xsession/run @@ -1,4 +1,4 @@ -#!/command/execlineb +#!/command/execlineb -P fdmove -c 2 1 s6-envdir env