Skip to content

Commit

Permalink
..init=systemd: run 'loginctl enable-linger USER' #417
Browse files Browse the repository at this point in the history
  • Loading branch information
mviereck committed Feb 23, 2022
1 parent 7cde9a1 commit 40eba6c
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 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.1-beta-2"
Version="7.1.1-beta-3"

# --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 @@ -2182,6 +2182,7 @@ setup_sound_pulseaudio() { # option --pulseaudio: set up pulseaudio connect
[ "$Pulseaudiomode" = "tcp" ] && [ "$Network" = "none" ] && {
note "Option --pulseaudio: Without option -I, --network
pulseaudio sound over TCP is not possible but needed in your setup."
Pulseaudiomode=""
check_fallback
return 1
}
Expand Down Expand Up @@ -6042,7 +6043,12 @@ export USER=\"\$Containeruser\"
# XDG_RUNTIME_DIR
Containeruseruid=\$(id -u \$Containeruser)
export XDG_RUNTIME_DIR=/tmp/XDG_RUNTIME_DIR
[ -e /run/user/\$Containeruseruid ] && ln -s /run/user/\$Containeruseruid \$XDG_RUNTIME_DIR || mkdir -p -m700 \$XDG_RUNTIME_DIR
[ -e /run/user/\$Containeruseruid ] && {
ln -s /run/user/\$Containeruseruid \$XDG_RUNTIME_DIR
export XDG_RUNTIME_DIR=/run/user/\$Containeruseruid
} || {
mkdir -p -m700 \$XDG_RUNTIME_DIR
}
"

# softlinks from shared folders to HOME
Expand Down Expand Up @@ -6234,6 +6240,9 @@ debugnote 'Running x11docker-login'
chmod +x $(convertpath share "$Containerrc")
\" >/usr/local/bin/x11docker-login
"
case "$Initsystem" in
systemd) echo "echo \"loginctl enable-linger \$Containeruser \" >>/usr/local/bin/x11docker-login" ;;
esac
case "$Backend" in
proot) echo "echo 'exec /bin/sh - $(convertpath share "$Containerrc")' >>/usr/local/bin/x11docker-login" ;;
docker|podman|nerdctl|chroot) echo "echo \"exec su - -s /bin/sh \$Containeruser $(convertpath share "$Containerrc")\" >>/usr/local/bin/x11docker-login" ;;
Expand Down Expand Up @@ -6384,6 +6393,7 @@ esac"
return 0
}
rootrc_prepare_dbus() {
#org.freedesktop.systemd1
echo "
# Prepare DBus services
Unservicelist='
Expand All @@ -6393,7 +6403,6 @@ org.freedesktop.hostname1
org.freedesktop.network1
org.freedesktop.resolve1
org.freedesktop.secrets
org.freedesktop.systemd1
org.freedesktop.timedate1
org.freedesktop.Tracker1
org.freedesktop.Tracker1.Miner.Extract
Expand Down Expand Up @@ -7312,12 +7321,16 @@ $(tail "$Xpraclientlogfile")"
start_pulseaudiotcp() { # option --pulseaudio=tcp: load Pulseaudio TCP module authenticated with container IP
local Containerip
Containerip="$(storeinfo dump containerip)"
Pulseaudiomoduleid="$(unpriv "pactl load-module module-native-protocol-tcp port=$Pulseaudioport auth-ip-acl=${Containerip:-"127.0.0.1"}" )"
set -x
#Pulseaudiomoduleid="$(unpriv "pactl load-module module-native-protocol-tcp listen=${Containerip:-"127.0.0.1"}" )"
Pulseaudiomoduleid="$(unpriv "pactl load-module module-native-protocol-tcp port=$Pulseaudioport listen=${Containerip:-"127.0.0.1"}" )"
# Pulseaudiomoduleid="$(unpriv "pactl load-module module-native-protocol-tcp port=$Pulseaudioport auth-ip-acl=${Containerip:-"127.0.0.1"}" )"
[ "$Pulseaudiomoduleid" ] && {
storeinfo "pulseaudiomoduleid=$Pulseaudiomoduleid"
} || note "Option --pulseaudio: command pactl failed.
Is pulseaudio running at all on your host?
You can try option --alsa instead."
set +x
return 0
}

Expand Down Expand Up @@ -8037,7 +8050,7 @@ check_options_arguments() { # check for [likely] valid arguments
Xcontainer="auto"
;;
esac

return 0
}
check_options_interferences() { # check multiple option interferences, change settings if needed
Expand Down

0 comments on commit 40eba6c

Please sign in to comment.