=== modified file 'sbin/ns_run' --- sbin/ns_run 2020-12-18 05:25:10 +0000 +++ sbin/ns_run 2020-12-18 05:08:53 +0000 @@ -23,10 +23,9 @@ # import variables from environment, with defaults multisubstitute { - importas -D container HOST HOST - importas -D /mnt/chroot NS_ROOT NS_ROOT importas -D mnt/ns NS_TMPFS NS_TMPFS importas -D /mnt/volumes/containers/bin NS_BIN NS_BIN + importas -D /mnt/chroot NS_ROOT NS_ROOT } # check we are PID1 (in a new PID namespace) === modified file 'service_scripts/generic/run' --- service_scripts/generic/run 2020-12-18 05:25:10 +0000 +++ service_scripts/generic/run 2020-12-16 21:55:20 +0000 @@ -18,17 +18,12 @@ 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} - -#multisubstitute { importas -i UID UID importas -i GID GID } +s6-envuidgid -B ${CONTAINER_USER}:${CONTAINER_USER} +multisubstitute { importas -i UID UID importas -i GID GID } env HOST=${CONTAINER_NAME} - #RUN_CHOWN=${UID}:${GID} + 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} /root/ns_run data/root /mnt/ns/bin/s6-applyuidgid -U ${CONTAINER_USER_HOME}/run/init === modified file 'service_scripts/xsession/run' --- service_scripts/xsession/run 2020-12-18 05:25:10 +0000 +++ service_scripts/xsession/run 2020-12-16 21:55:20 +0000 @@ -16,21 +16,23 @@ 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/GIDLIST into environment for use by s6-applyuidgid below s6-envuidgid ${CONTAINER_USER} - -# Run user's script to populate /home /run and/or /tmp -if { - env HOME=${CONTAINER_USER_HOME} - s6-applyuidgid -U - ${CONTAINER_USER_HOME}/xsession-setup ${CONTAINER_TMPFS} 6 -} - +if { env HOME=${CONTAINER_USER_HOME} s6-applyuidgid -U ${CONTAINER_USER_HOME}/xsession-setup ${CONTAINER_TMPFS} 6 } env + HOST=carbon NS_EXTRA="if { mount -o bind,ro /etc/passwd etc/passwd } if { mount -o bind,ro /etc/group etc/group }" - -unshare -n # make new network namespace -if { ip addr add 127.0.0.1/24 dev lo } - +unshare -n /root/ns_run data/root /mnt/ns/bin/s6-applyuidgid -U /run/init + + +# if { rm -rf /run/containers/xsession.6.ccx } +# if { mkdir -p /run/containers/xsession.6.ccx/home /run/containers/xsession.6.ccx/run /run/containers/xsession.6.ccx/tmp } +# if { chmod 1770 /run/containers/xsession.6.ccx/home /run/containers/xsession.6.ccx/run /run/containers/xsession.6.ccx/tmp } +# if { chown root:ccx /run/containers/xsession.6.ccx/home /run/containers/xsession.6.ccx/run /run/containers/xsession.6.ccx/tmp } +# if { mount -a --fstab /mnt/volumes/containers/user/ccx/xsession.6/fstab } +# if { env HOME=/home/ccx s6-applyuidgid -u 1000 -g 100 -G 1000 /home/ccx/xsession-setup /run/containers/xsession.6.ccx 6 } +# env +# HOST=carbon +# NS_EXTRA="if { mount -o bind,ro /etc/passwd etc/passwd } if { mount -o bind,ro /etc/group etc/group }" +# unshare -n +# /root/ns_run /mnt/volumes/containers/user/ccx/xsession.6/root /mnt/ns/bin/s6-applyuidgid -u 1000 -g 100 -G 1000 /run/init