mrrl-containers

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

commit e70bce2f23fb17fd0a91aec1c34f202490e54495
parent 5b3f5e9b19ca414f04be3d5ea58d0941f9d94070
Author: ccx <ccx@te2000.cz>
Date:   Sun, 17 Mar 2024 00:13:06 +0000

use applyuidgid-caps

Diffstat:
Msbin/container_sysroot_run | 6+++---
Mservice_scripts/alsa/run | 10+++++-----
Mservice_scripts/generic/run | 8++++----
Mservice_scripts/sysroot/run | 6+++---
Mservice_scripts/xsession/run | 10+++++-----
5 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/sbin/container_sysroot_run b/sbin/container_sysroot_run @@ -14,9 +14,9 @@ multisubstitute { getpid NS_PID foreground { importas -i NS_PID NS_PID - if { test -d /run/cgroup2 } - if { mkdir -p /run/cgroup2/containers/${CONTAINER_USER}/${CONTAINER_NAME} } - redirfd -w 1 /run/cgroup2/containers/${CONTAINER_USER}/${CONTAINER_NAME}/cgroup.procs + if { test -d /run/cgroup } + if { mkdir -p /run/cgroup/containers/${CONTAINER_USER}/${CONTAINER_NAME} } + redirfd -w 1 /run/cgroup/containers/${CONTAINER_USER}/${CONTAINER_NAME}/cgroup.procs printf "%s" ${NS_PID} } diff --git a/service_scripts/alsa/run b/service_scripts/alsa/run @@ -18,9 +18,9 @@ multisubstitute { getpid NS_PID foreground { importas -i NS_PID NS_PID - if { test -d /run/cgroup2 } - if { mkdir -p /run/cgroup2/containers/${CONTAINER_USER}/${CONTAINER_NAME} } - redirfd -w 1 /run/cgroup2/containers/${CONTAINER_USER}/${CONTAINER_NAME}/cgroup.procs + if { test -d /run/cgroup } + if { mkdir -p /run/cgroup/containers/${CONTAINER_USER}/${CONTAINER_NAME} } + redirfd -w 1 /run/cgroup/containers/${CONTAINER_USER}/${CONTAINER_NAME}/cgroup.procs printf "%s" ${NS_PID} } @@ -42,7 +42,7 @@ s6-envuidgid ${CONTAINER_USER} if { ifelse { test -x ${CONTAINER_USER_HOME}/container-setup } { env HOME=${CONTAINER_USER_HOME} USER=${CONTAINER_USER} - s6-applyuidgid -U + applyuidgid-caps -U "" ${CONTAINER_USER_HOME}/container-setup ${CONTAINER_TMPFS} ${CONTAINER_NAME} } } @@ -60,6 +60,6 @@ if { ip link set lo up } # Put UID/GID/GIDLIST into environment for use by s6-applyuidgid below emptyenv -c ns_run data/root -/mnt/ns/bin/s6-applyuidgid -U +/mnt/ns/current/command/applyuidgid-caps -U "" env HOME=${CONTAINER_USER_HOME} USER=${CONTAINER_USER} ${CONTAINER_USER_HOME}/run/init diff --git a/service_scripts/generic/run b/service_scripts/generic/run @@ -18,9 +18,9 @@ multisubstitute { getpid NS_PID foreground { importas -i NS_PID NS_PID - if { test -d /run/cgroup2 } - if { mkdir -p /run/cgroup2/containers/${CONTAINER_USER}/${CONTAINER_NAME} } - redirfd -w 1 /run/cgroup2/containers/${CONTAINER_USER}/${CONTAINER_NAME}/cgroup.procs + if { test -d /run/cgroup } + if { mkdir -p /run/cgroup/containers/${CONTAINER_USER}/${CONTAINER_NAME} } + redirfd -w 1 /run/cgroup/containers/${CONTAINER_USER}/${CONTAINER_NAME}/cgroup.procs printf "%s" ${NS_PID} } @@ -54,6 +54,6 @@ env emptyenv -c ns_run data/root -/mnt/ns/bin/s6-applyuidgid -U +/mnt/ns/current/command/applyuidgid-caps -U "" env HOME=${CONTAINER_USER_HOME} USER=${CONTAINER_USER} ${CONTAINER_USER_HOME}/run/init diff --git a/service_scripts/sysroot/run b/service_scripts/sysroot/run @@ -16,9 +16,9 @@ multisubstitute { getpid NS_PID foreground { importas -i NS_PID NS_PID - if { test -d /run/cgroup2 } - if { mkdir -p /run/cgroup2/containers/${CONTAINER_USER}/${CONTAINER_NAME} } - redirfd -w 1 /run/cgroup2/containers/${CONTAINER_USER}/${CONTAINER_NAME}/cgroup.procs + if { test -d /run/cgroup } + if { mkdir -p /run/cgroup/containers/${CONTAINER_USER}/${CONTAINER_NAME} } + redirfd -w 1 /run/cgroup/containers/${CONTAINER_USER}/${CONTAINER_NAME}/cgroup.procs printf "%s" ${NS_PID} } diff --git a/service_scripts/xsession/run b/service_scripts/xsession/run @@ -19,9 +19,9 @@ multisubstitute { getpid NS_PID foreground { importas -i NS_PID NS_PID - if { test -d /run/cgroup2 } - if { mkdir -p /run/cgroup2/containers/${CONTAINER_USER}/${CONTAINER_NAME} } - redirfd -w 1 /run/cgroup2/containers/${CONTAINER_USER}/${CONTAINER_NAME}/cgroup.procs + if { test -d /run/cgroup } + if { mkdir -p /run/cgroup/containers/${CONTAINER_USER}/${CONTAINER_NAME} } + redirfd -w 1 /run/cgroup/containers/${CONTAINER_USER}/${CONTAINER_NAME}/cgroup.procs printf "%s" ${NS_PID} } @@ -37,7 +37,7 @@ s6-envuidgid ${CONTAINER_USER} # Run user's script to populate /home /run and/or /tmp if { env HOME=${CONTAINER_USER_HOME} USER=${CONTAINER_USER} - s6-applyuidgid -U + applyuidgid-caps -U "" ${CONTAINER_USER_HOME}/xsession-setup ${CONTAINER_TMPFS} ${vtN} } @@ -51,6 +51,6 @@ if { ip link set lo up } emptyenv -c ns_run data/root -/mnt/ns/bin/s6-applyuidgid -U +/mnt/ns/current/command/applyuidgid-caps -U "" env HOME=${CONTAINER_USER_HOME} USER=${CONTAINER_USER} /run/init