From 30fd58db07b245c41b3267862a52140cc8c2473f Mon Sep 17 00:00:00 2001 From: mviereck Date: Wed, 9 Feb 2022 18:23:34 +0100 Subject: [PATCH] --init=systemd --backend=podman: Use --systemd=always #349 --- x11docker | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/x11docker b/x11docker index e5a0ad54..214c09c3 100755 --- a/x11docker +++ b/x11docker @@ -11,7 +11,7 @@ # Run 'x11docker --help' or scroll down to read usage information. # More documentation at: https://github.com/mviereck/x11docker -Version="7.1.0-beta-7" +Version="7.1.0-beta-8" # --enforce-i: Enforce running in interactive mode to allow commands tty and weston-launch in special setups. grep -q -- "--enforce-i" <<< "$*" && case $- in @@ -4978,7 +4978,7 @@ create_backendcommand() { ### create command to run docker ;; esac - # --init: setup for tini + # --init case "$Initsystem" in dockerinit) case "$Backend" in @@ -5005,6 +5005,12 @@ create_backendcommand() { ### create command to run docker ;; esac ;; + systemd) + Backendcommand="$Backendcommand \\ + --tmpfs /var/lib/journal \\ + --tmpfs /sys/fs/cgroup/systemd" + [ "$Backend" = "podman" ] && Backendcommand="$Backendcommand \\ + --systemd=always" esac # stop signal for some init systems @@ -5022,7 +5028,7 @@ create_backendcommand() { ### create command to run docker case "$Backend" in docker|podman|nerdctl) Backendcommand="$Backendcommand \\ - --volume $(convertpath volume /sys/fs/cgroup:ro /sys/fs/cgroup)" + --volume $(convertpath volume /sys/fs/cgroup /sys/fs/cgroup)" # --mount type=bind,source=/sys/fs/cgroup,target=/sys/fs/cgroup,readonly" ;; esac @@ -5033,7 +5039,8 @@ create_backendcommand() { ### create command to run docker docker|podman) Backendcommand="$Backendcommand \\ --tmpfs /run:exec \\ - --tmpfs /run/lock" + --tmpfs /run/lock \\ + --tmpfs /tmp" ;; esac @@ -5420,7 +5427,6 @@ setup_capabilities() { # check linux capabilities needed by container systemd) Switchcontaineruser="yes" store_runoption cap "FSETID FOWNER SETPCAP SYS_BOOT" - Sharecgroup="yes" ;; runit|openrc|sysvinit) Switchcontaineruser="yes" @@ -5569,6 +5575,7 @@ setup_initsystem() { # option init: set up capabilities, check or cre systemd) Stopsignal="SIGRTMIN+3" Containerusergroups="$Containerusergroups systemd-journal" + Sharecgroup="yes" ;; runit) Stopsignal="HUP" @@ -5989,7 +5996,7 @@ export XDG_RUNTIME_DIR=/tmp/XDG_RUNTIME_DIR echo " # Copy files from /etc/skel into empty HOME [ -d \"\$HOME\" ] && { - [ -d /etc/skel ] && [ -z \"\$(ls -A \"\$Containeruserhome\" 2>/dev/null | grep -v -E \"gnupg${Ungrep}\")\" ] && { + [ -d /etc/skel ] && [ -z \"\$(ls -A \"\$Containeruserhome\" 2>/dev/null | grep -v -E \"\.bashrc|\.profile|gnupg${Ungrep}\")\" ] && { debugnote \"containerrc: HOME is empty. Copying from /etc/skel\" cp -n -R /etc/skel/. \$Containeruserhome : @@ -6903,7 +6910,7 @@ start_container() { # docker run # check and set up cgroup on host for systemd or elogind # run docker local Containerid= Containerip= Containerinspect= - local Failure= + local Failure= Pid1pid= # [ "$Winsubsystem" = "MSYS2" ] && { ### FIXME check if needed # # avoid path conversion in MSYS2 commands @@ -7322,7 +7329,8 @@ check_host() { # check host environment proot|chroot) Xcontainerimage="" ;; host) Xcontainerimage="" ;; esac - [ "$Xcontainerimage" ] && Xtoolscontainer="yes" + #[ "$Xcontainerimage" ] && Xtoolscontainer="yes" + [ "$Xcontainer" = "yes" ] && Xtoolscontainer="yes" # Check host IP. Needed for --pulseaudio=tcp, --printer=tcp, --xoverip and --xwin case "$Winsubsystem" in