Skip to content

Commit

Permalink
--init=systemd --backend=podman: Use --systemd=always #349
Browse files Browse the repository at this point in the history
  • Loading branch information
mviereck committed Feb 9, 2022
1 parent f867251 commit 30fd58d
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions x11docker
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -4978,7 +4978,7 @@ create_backendcommand() { ### create command to run docker
;;
esac

# --init: setup for tini
# --init
case "$Initsystem" in
dockerinit)
case "$Backend" in
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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
:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 30fd58d

Please sign in to comment.