Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/stderr <==
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/stdout <==
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/container.log <==
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/message.log <==
- DEBUGNOTE[07:11:12,591]: check_host(): ps can watch root processes: yes
- x11docker[07:11:12,604]: Image name: rstudioxhost:verse
- Container command:
- x11docker WARNING: User ignacio is member of group docker.
- That allows unprivileged processes on host to gain root privileges.
- DEBUGNOTE[07:11:12,988]: storeinfo(): cache=/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372
- DEBUGNOTE[07:11:13,000]: storeinfo(): stdout=/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/stdout
- DEBUGNOTE[07:11:13,013]: storeinfo(): stderr=/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/stderr
- DEBUGNOTE[07:11:13,048]: storeinfo(): x11dockerpid=114404
- DEBUGNOTE[07:11:13,114]:
- x11docker version: 6.4.0
- docker version: Docker version 19.03.4, build 9013bf583a
- Host system: "Debian GNU/Linux bullseye/sid"
- Command: '/usr/bin/x11docker' 'rstudioxhost:verse'
- Parsed options: -- 'rstudioxhost:verse'
- DEBUGNOTE[07:11:13,120]: --xpra: xpra not found.
- You can look for the package name of this command at:
- https://github.com/mviereck/x11docker/wiki/dependencies#table-of-all-packages
- DEBUGNOTE[07:11:13,124]: Dependency check for --xpra: 1
- DEBUGNOTE[07:11:13,127]: --xpra not possible: missing dependencies.
- DEBUGNOTE[07:11:13,131]: Dependencies of --xpra already checked: 1
- DEBUGNOTE[07:11:13,135]: --nxagent: nxagent not found.
- You can look for the package name of this command at:
- https://github.com/mviereck/x11docker/wiki/dependencies#table-of-all-packages
- DEBUGNOTE[07:11:13,139]: Dependency check for --nxagent: 1
- DEBUGNOTE[07:11:13,144]: --nxagent not possible: missing dependencies.
- DEBUGNOTE[07:11:13,148]: --xephyr: Neither Xephyr nor Xnest found.
- You can look for the package name of this command at:
- https://github.com/mviereck/x11docker/wiki/dependencies#table-of-all-packages
- DEBUGNOTE[07:11:13,153]: Dependency check for --xephyr: 1
- DEBUGNOTE[07:11:13,157]: --xephyr not possible: missing dependencies.
- DEBUGNOTE[07:11:13,161]: Dependencies of --xephyr already checked: 1
- DEBUGNOTE[07:11:13,166]: --kwin-xwayland: Closed source NVIDIA driver does not support Wayland.
- DEBUGNOTE[07:11:13,171]: --kwin-xwayland: kwin_wayland not found.
- You can look for the package name of this command at:
- https://github.com/mviereck/x11docker/wiki/dependencies#table-of-all-packages
- DEBUGNOTE[07:11:13,176]: --kwin-xwayland: Xwayland not found.
- You can look for the package name of this command at:
- https://github.com/mviereck/x11docker/wiki/dependencies#table-of-all-packages
- DEBUGNOTE[07:11:13,181]: Dependency check for --kwin-xwayland: 1
- DEBUGNOTE[07:11:13,186]: --kwin-xwayland not possible: missing dependencies.
- DEBUGNOTE[07:11:13,191]: Dependency check for --hostdisplay: 0
- DEBUGNOTE[07:11:13,196]: --xwin: XWin is available in Cygwin on MS Windows only.
- DEBUGNOTE[07:11:13,200]: Dependency check for --xwin: 1
- DEBUGNOTE[07:11:13,205]: --xwin not possible: missing dependencies.
- DEBUGNOTE[07:11:13,210]: --nxagent: nxagent not found.
- You can look for the package name of this command at:
- https://github.com/mviereck/x11docker/wiki/dependencies#table-of-all-packages
- DEBUGNOTE[07:11:13,215]: Dependency check for --nxagent: 1
- DEBUGNOTE[07:11:13,220]: --nxagent not possible: missing dependencies.
- DEBUGNOTE[07:11:13,225]: --weston-xwayland: Closed source NVIDIA driver does not support Wayland.
- DEBUGNOTE[07:11:13,231]: --weston-xwayland: weston not found.
- You can look for the package name of this command at:
- https://github.com/mviereck/x11docker/wiki/dependencies#table-of-all-packages
- DEBUGNOTE[07:11:13,236]: --weston-xwayland: Xwayland not found.
- You can look for the package name of this command at:
- https://github.com/mviereck/x11docker/wiki/dependencies#table-of-all-packages
- DEBUGNOTE[07:11:13,240]: Dependency check for --weston-xwayland: 1
- DEBUGNOTE[07:11:13,245]: --weston-xwayland not possible: missing dependencies.
- DEBUGNOTE[07:11:13,251]: --xpra: xpra not found.
- You can look for the package name of this command at:
- https://github.com/mviereck/x11docker/wiki/dependencies#table-of-all-packages
- DEBUGNOTE[07:11:13,256]: Dependency check for --xpra: 1
- DEBUGNOTE[07:11:13,261]: --xpra not possible: missing dependencies.
- DEBUGNOTE[07:11:13,267]: Dependency check for --hostdisplay: 0
- DEBUGNOTE[07:11:13,271]: Dependencies of --hostdisplay already checked: 0
- x11docker note: Using X server option --hostdisplay
- DEBUGNOTE[07:11:13,277]: storeinfo(): xserver=--hostdisplay
- x11docker WARNING: Clipboard isolation may fail.
- x11docker note: To allow protection against X security leaks,
- please install 'xinit' and one or more of:
- xpra, Xephyr, nxagent, weston+Xwayland, kwin_wayland+Xwayland or Xnest,
- or run a second Xorg server with option --xorg.
- x11docker WARNING: Option --hostdisplay provides only low container isolation!
- It is recommended to use another X server option like --xpra or --nxagent.
- To improve security with --hostdisplay x11docker uses untrusted cookies.
- This can lead to strange behaviour of some applications.
- If you encounter application [41merrors[0m, enable option --clipboard
- that disables security restrictions for --hostdisplay as a side effect.
- x11docker note: Option --hostdisplay may fail with proprietary NVIDIA driver
- on host. In that case try other X server options like --xpra or --xephyr.
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/xinit.log <==
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/stderr <==
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/stdout <==
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/container.log <==
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/message.log <==
- DEBUGNOTE[07:11:12,591]: check_host(): ps can watch root processes: yes
- x11docker[07:11:12,604]: Image name: rstudioxhost:verse
- Container command:
- x11docker WARNING: User ignacio is member of group docker.
- That allows unprivileged processes on host to gain root privileges.
- DEBUGNOTE[07:11:12,988]: storeinfo(): cache=/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372
- DEBUGNOTE[07:11:13,000]: storeinfo(): stdout=/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/stdout
- DEBUGNOTE[07:11:13,013]: storeinfo(): stderr=/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/stderr
- DEBUGNOTE[07:11:13,048]: storeinfo(): x11dockerpid=114404
- DEBUGNOTE[07:11:13,114]:
- x11docker version: 6.4.0
- docker version: Docker version 19.03.4, build 9013bf583a
- Host system: "Debian GNU/Linux bullseye/sid"
- Command: '/usr/bin/x11docker' 'rstudioxhost:verse'
- Parsed options: -- 'rstudioxhost:verse'
- DEBUGNOTE[07:11:13,120]: --xpra: xpra not found.
- You can look for the package name of this command at:
- https://github.com/mviereck/x11docker/wiki/dependencies#table-of-all-packages
- DEBUGNOTE[07:11:13,124]: Dependency check for --xpra: 1
- DEBUGNOTE[07:11:13,127]: --xpra not possible: missing dependencies.
- DEBUGNOTE[07:11:13,131]: Dependencies of --xpra already checked: 1
- DEBUGNOTE[07:11:13,135]: --nxagent: nxagent not found.
- You can look for the package name of this command at:
- https://github.com/mviereck/x11docker/wiki/dependencies#table-of-all-packages
- DEBUGNOTE[07:11:13,139]: Dependency check for --nxagent: 1
- DEBUGNOTE[07:11:13,144]: --nxagent not possible: missing dependencies.
- DEBUGNOTE[07:11:13,148]: --xephyr: Neither Xephyr nor Xnest found.
- You can look for the package name of this command at:
- https://github.com/mviereck/x11docker/wiki/dependencies#table-of-all-packages
- DEBUGNOTE[07:11:13,153]: Dependency check for --xephyr: 1
- DEBUGNOTE[07:11:13,157]: --xephyr not possible: missing dependencies.
- DEBUGNOTE[07:11:13,161]: Dependencies of --xephyr already checked: 1
- DEBUGNOTE[07:11:13,166]: --kwin-xwayland: Closed source NVIDIA driver does not support Wayland.
- DEBUGNOTE[07:11:13,171]: --kwin-xwayland: kwin_wayland not found.
- You can look for the package name of this command at:
- https://github.com/mviereck/x11docker/wiki/dependencies#table-of-all-packages
- DEBUGNOTE[07:11:13,176]: --kwin-xwayland: Xwayland not found.
- You can look for the package name of this command at:
- https://github.com/mviereck/x11docker/wiki/dependencies#table-of-all-packages
- DEBUGNOTE[07:11:13,181]: Dependency check for --kwin-xwayland: 1
- DEBUGNOTE[07:11:13,186]: --kwin-xwayland not possible: missing dependencies.
- DEBUGNOTE[07:11:13,191]: Dependency check for --hostdisplay: 0
- DEBUGNOTE[07:11:13,196]: --xwin: XWin is available in Cygwin on MS Windows only.
- DEBUGNOTE[07:11:13,200]: Dependency check for --xwin: 1
- DEBUGNOTE[07:11:13,205]: --xwin not possible: missing dependencies.
- DEBUGNOTE[07:11:13,210]: --nxagent: nxagent not found.
- You can look for the package name of this command at:
- https://github.com/mviereck/x11docker/wiki/dependencies#table-of-all-packages
- DEBUGNOTE[07:11:13,215]: Dependency check for --nxagent: 1
- DEBUGNOTE[07:11:13,220]: --nxagent not possible: missing dependencies.
- DEBUGNOTE[07:11:13,225]: --weston-xwayland: Closed source NVIDIA driver does not support Wayland.
- DEBUGNOTE[07:11:13,231]: --weston-xwayland: weston not found.
- You can look for the package name of this command at:
- https://github.com/mviereck/x11docker/wiki/dependencies#table-of-all-packages
- DEBUGNOTE[07:11:13,236]: --weston-xwayland: Xwayland not found.
- You can look for the package name of this command at:
- https://github.com/mviereck/x11docker/wiki/dependencies#table-of-all-packages
- DEBUGNOTE[07:11:13,240]: Dependency check for --weston-xwayland: 1
- DEBUGNOTE[07:11:13,245]: --weston-xwayland not possible: missing dependencies.
- DEBUGNOTE[07:11:13,251]: --xpra: xpra not found.
- You can look for the package name of this command at:
- https://github.com/mviereck/x11docker/wiki/dependencies#table-of-all-packages
- DEBUGNOTE[07:11:13,256]: Dependency check for --xpra: 1
- DEBUGNOTE[07:11:13,261]: --xpra not possible: missing dependencies.
- DEBUGNOTE[07:11:13,267]: Dependency check for --hostdisplay: 0
- DEBUGNOTE[07:11:13,271]: Dependencies of --hostdisplay already checked: 0
- x11docker note: Using X server option --hostdisplay
- DEBUGNOTE[07:11:13,277]: storeinfo(): xserver=--hostdisplay
- x11docker WARNING: Clipboard isolation may fail.
- x11docker note: To allow protection against X security leaks,
- please install 'xinit' and one or more of:
- xpra, Xephyr, nxagent, weston+Xwayland, kwin_wayland+Xwayland or Xnest,
- or run a second Xorg server with option --xorg.
- x11docker WARNING: Option --hostdisplay provides only low container isolation!
- It is recommended to use another X server option like --xpra or --nxagent.
- To improve security with --hostdisplay x11docker uses untrusted cookies.
- This can lead to strange behaviour of some applications.
- If you encounter application [41merrors[0m, enable option --clipboard
- that disables security restrictions for --hostdisplay as a side effect.
- x11docker note: Option --hostdisplay may fail with proprietary NVIDIA driver
- on host. In that case try other X server options like --xpra or --xephyr.
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/xinit.log <==
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/message.log <==
- DEBUGNOTE[07:11:13,359]: waitforlogentry(): tailstdout: Waiting for logentry "x11docker=ready" in store.info
- DEBUGNOTE[07:11:13,360]: waitforlogentry(): tailstderr: Waiting for logentry "x11docker=ready" in store.info
- DEBUGNOTE[07:11:13,381]: storepid(): Stored pid '114934' of 'watchpidlist': 114934 pts/4 00:00:00 bash
- DEBUGNOTE[07:11:13,407]: storepid(): Stored pid '114947' of 'watchmessagefifo': 114947 pts/4 00:00:00 bash
- x11docker[07:11:13,443]: Virtual screen size: 3840x2160
- x11docker[07:11:13,455]: Physical screen size:
- Screen 0: minimum 8 x 8, current 3840 x 2160, maximum 32767 x 32767
- x11docker[07:11:13,472]: Detected host window manager: cinnamon --sm-disable
- DEBUGNOTE[07:11:13,495]: storeinfo(): DISPLAY=:0
- DEBUGNOTE[07:11:13,506]: storeinfo(): XAUTHORITY=/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client
- DEBUGNOTE[07:11:13,518]: storeinfo(): XSOCKET=/tmp/.X11-unix/X0
- DEBUGNOTE[07:11:13,531]: storeinfo(): XDG_RUNTIME_DIR=/run/user/738202
- DEBUGNOTE[07:11:13,541]: storeinfo(): Xenv= DISPLAY=:0 XAUTHORITY=/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client XSOCKET=/tmp/.X11-unix/X0 XDG_RUNTIME_DIR=/run/user/738202
- x11docker[07:11:13,695]: --init: Found tini binary: /usr/bin/docker-init
- DEBUGNOTE[07:11:13,700]: storeinfo(): tini=/usr/bin/docker-init
- DEBUGNOTE[07:11:13,716]: Users and terminal:
- x11docker was started by: ignacio
- As host user serves (running X, storing cache): ignacio
- Container user will be: ignacio
- Container user password: x11docker
- Getting permission to run docker with: eval
- Terminal for password frontend: bash -c
- Running in a terminal: yes
- Running on console: no
- Running over SSH: no
- Running sourced: no
- bash $-: hB
- DEBUGNOTE[07:11:13,720]: storeinfo(): containername=x11docker_X0_rstudioxhost-verse_30672295372
- DEBUGNOTE[07:11:14,088]: Docker command:
- docker run --tty --rm --detach \
- --name x11docker_X0_rstudioxhost-verse_30672295372 \
- --user 738202:89939 \
- --env USER=ignacio \
- --userns host \
- --cap-drop ALL \
- --security-opt no-new-privileges \
- --security-opt label=type:container_runtime_t \
- --volume '/usr/bin/docker-init':'/usr/local/bin/tini':ro \
- --tmpfs /run --tmpfs /run/lock \
- --volume '/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share':'/x11docker':rw \
- --volume '/tmp/.X11-unix/X0':'/X0':rw \
- --workdir '/tmp' \
- --entrypoint env \
- --env 'container=docker' \
- --env 'XAUTHORITY=/x11docker/Xauthority.client' \
- --env 'DISPLAY=:0' \
- --env 'XDG_RUNTIME_DIR=/tmp/XDG_RUNTIME_DIR' \
- -- rstudioxhost:verse /usr/local/bin/tini -- /bin/sh - /x11docker/containerrc
- x11docker[07:11:14,300]: Generated dockerrc:
- 1 #! /usr/bin/env bash
- 2
- 3 # dockerrc:
- 4 # This script runs as root (or member of group docker) on host.
- 5 # - inspect image
- 6 # - pull image if needed
- 7 # - create containerrc
- 8 # - set up systemd/elogind cgroup if needed
- 9 # - run window manager in container or from host if needed
- 10
- 11 trap '' SIGINT
- 12
- 13 askyesno ()
- 14 {
- 15 local Choice;
- 16 read -t60 -n1 -p "(timeout after 60s assuming no) [Y|n]" Choice;
- 17 [ "$?" = '0' ] && {
- 18 [[ "$Choice" == [YyJj]* ]] || [ -z "$Choice" ] && return 0
- 19 };
- 20 return 1
- 21 }
- 22 checkpid ()
- 23 {
- 24 [ -e "/proc/${1:-NONSENSE}" ]
- 25 }
- 26 escapestring ()
- 27 {
- 28 echo "${1:-}" | LC_ALL=C sed -e 's/[^a-zA-Z0-9,._+@=:/-]/\\&/g; 1{$s/^$/""/}; 1!s/^/"/; $!s/$/"/'
- 29 }
- 30 mysleep ()
- 31 {
- 32 sleep "${1:-1}" 2> /dev/null || sleep 1
- 33 }
- 34 pspid ()
- 35 {
- 36 LC_ALL=C ps -p "${1:-}" 2> /dev/null | grep -v 'TIME'
- 37 }
- 38 rmcr ()
- 39 {
- 40 case "${1:-}" in
- 41 "")
- 42 sed "s/$(printf "\r")//g"
- 43 ;;
- 44 *)
- 45 sed -i "s/$(printf "\r")//g" "${1:-}"
- 46 ;;
- 47 esac
- 48 }
- 49 rocknroll ()
- 50 {
- 51 [ -s "$Timetosaygoodbyefile" ] && return 1;
- 52 [ -e "$Timetosaygoodbyefile" ] || return 1;
- 53 return 0
- 54 }
- 55 saygoodbye ()
- 56 {
- 57 debugnote "time to say goodbye ($*)";
- 58 [ -e "$Timetosaygoodbyefile" ] && echo timetosaygoodbye >> $Timetosaygoodbyefile;
- 59 [ -e "$Timetosaygoodbyefifo" ] && echo timetosaygoodbye >> $Timetosaygoodbyefifo
- 60 }
- 61 storeinfo ()
- 62 {
- 63 [ -e "$Storeinfofile" ] || return 1;
- 64 case "${1:-}" in
- 65 dump)
- 66 grep "^${2:-}=" $Storeinfofile | sed "s/^${2:-}=//"
- 67 ;;
- 68 drop)
- 69 sed -i "/^${2:-}=/d" $Storeinfofile
- 70 ;;
- 71 test)
- 72 grep -q "^${2:-}=" $Storeinfofile
- 73 ;;
- 74 *)
- 75 debugnote "storeinfo(): ${1:-}";
- 76 grep -q "^$(echo "${1:-}" | cut -d= -f1)=" $Storeinfofile && {
- 77 sed -i "/^$(echo "${1:-}" | cut -d= -f1)=/d" $Storeinfofile
- 78 };
- 79 echo "${1:-}" >> $Storeinfofile
- 80 ;;
- 81 esac
- 82 }
- 83 storepid ()
- 84 {
- 85 case "${1:-}" in
- 86 dump)
- 87 grep -w "${2:-}" "$Storepidfile" | cut -d' ' -f1
- 88 ;;
- 89 test)
- 90 grep -q -w "${2:-}" "$Storepidfile"
- 91 ;;
- 92 *)
- 93 echo "${1:-NOPID}" "${2:-NONAME}" >> "$Storepidfile";
- 94 debugnote "storepid(): Stored pid '${1:-}' of '${2:-}': $(pspid ${1:-} ||:)"
- 95 ;;
- 96 esac
- 97 }
- 98 waitforlogentry ()
- 99 {
- 100 local Startzeit Uhrzeit Dauer Count=0 Schlaf;
- 101 local Errorkeys="${4:-}";
- 102 local Warten="${5:-60}";
- 103 Startzeit="$(date +%s ||:)";
- 104 Startzeit="${Startzeit:-0}";
- 105 [ "$Warten" = "infinity" ] && Warten=32000;
- 106 debugnote "waitforlogentry(): ${1:-}: Waiting for logentry \"${3:-}\" in $(basename ${2:-})";
- 107 while ! grep -q "${3:-}" < "${2:-}"; do
- 108 Count="$(( $Count + 1 ))";
- 109 Uhrzeit="$(date +%s ||:)";
- 110 Uhrzeit="${Uhrzeit:-0}";
- 111 Dauer="$(( $Uhrzeit - $Startzeit ))";
- 112 Schlaf="$(( $Count / 10 ))";
- 113 [ "$Schlaf" = "0" ] && Schlaf="0.5";
- 114 mysleep "$Schlaf";
- 115 [ "$Dauer" -gt "10" ] && debugnote "waitforlogentry(): ${1:-}: Waiting since ${Dauer}s for log entry \"${3:-}\" in $(basename ${2:-})";
- 116 [ "$Dauer" -gt "$Warten" ] && error "waitforlogentry(): ${1:-}: Timeout waiting for log entry \"${3:-}\" in $(basename ${2:-})
- 117 Last lines of logfile $(basename ${2:-}):
- 118 $(tail "${2:-}")";
- 119 [ "$Errorkeys" ] && grep -i -q -E "$Errorkeys" < "${2:-}" && error "waitforlogentry(): ${1:-}: Found error message in logfile.
- 120 Last lines of logfile $(basename ${2:-}):
- 121 $(tail "${2:-}")";
- 122 rocknroll || {
- 123 debugnote "waitforlogentry(): ${1:-}: Stopped waiting for ${3:-} in $(basename ${2:-}) due to terminating signal.";
- 124 return 1
- 125 };
- 126 done;
- 127 debugnote "waitforlogentry(): ${1:-}: Found log entry \"${3:-}\" in $(basename ${2:-}).";
- 128 return 0
- 129 }
- 130
- 131 warning() {
- 132 echo "$*:WARNING" | sed "s/\$/ /" >>$Messagefile
- 133 }
- 134 note() {
- 135 echo "$*:NOTE" | sed "s/\$/ /" >>$Messagefile
- 136 }
- 137 verbose() {
- 138 echo "$*:VERBOSE" | sed "s/\$/ /" >>$Messagefile
- 139 }
- 140 debugnote() {
- 141 echo "$*:DEBUGNOTE" | sed "s/\$/ /" >>$Messagefile
- 142 }
- 143 error() {
- 144 echo "$*:ERROR" | sed "s/\$/ /" >>$Messagefile
- 145 exit 64
- 146 }
- 147 stdout() {
- 148 echo "$*:STDOUT" | sed "s/\$/ /" >>$Messagefile
- 149 }
- 150
- 151 Containercommand=""
- 152 Imagename="rstudioxhost:verse"
- 153 Messagefile='/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/message.fifo'
- 154 Newxenv=' DISPLAY=:0 XAUTHORITY=/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client XSOCKET=/tmp/.X11-unix/X0 XDG_RUNTIME_DIR=/run/user/738202'
- 155 export PATH='/usr/local/buildtools/java/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games'
- 156 Storeinfofile='/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/store.info'
- 157 Storepidfile='/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/store.pids'
- 158 Timetosaygoodbyefile='/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/timetosaygoodbye'
- 159 Timetosaygoodbyefifo='/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/timetosaygoodbye.fifo'
- 160 Xserver='--hostdisplay'
- 161 Workdir=''
- 162
- 163 Containerid=
- 164 Containerip=
- 165 Dockerlogspid=''
- 166 Dockerpull=
- 167 Exec=
- 168 Entrypoint=
- 169 Failure=
- 170 Imageuser=
- 171 Inspect=
- 172 Line=
- 173 Pid1pid=
- 174 Runtime=
- 175 Signal=
- 176 Windowmanager=
- 177 Windowmanagercommand=
- 178 Wmcontainerid=
- 179 Wmdockercommand=
- 180 Workdir=
- 181 debugnote 'Running dockerrc: Setup as root or as user docker on host.'
- 182
- 183
- 184 # Check whether docker daemon is running, get docker info
- 185 docker info >>/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/docker.info 2>>/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/container.log || {
- 186 error "Calling docker daemon failed.
- 187 Is docker daemon running at all?
- 188 Try to start docker daemon with: systemctl start docker
- 189 Last lines of log:
- 190 $(rmcr < '/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/container.log' | tail)"
- 191 }
- 192
- 193 # Check default runtime
- 194 Runtime="$(grep 'Default Runtime' < '/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/docker.info' | awk '{print $3}')"
- 195 debugnote "dockerrc: Found default Runtime: $Runtime"
- 196 debugnote "dockerrc: All $(grep 'Runtimes' < '/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/docker.info')"
- 197 [ "$Runtime" != '' ] && {
- 198 case $Runtime in
- 199 kata-runtime) warning 'Found default docker runtime kata-runtime.
- 200 Please run x11docker with --runtime=kata-runtime to avoid issues.' ;;
- 201 nvidia) [ 'no' = 'yes' ] && warning 'Option --gpu: Found default docker runtime nvidia.
- 202 Please run x11docker with --runtime=nvidia to avoid issues.' ;;
- 203 runc|crun) ;;
- 204 *) warning "Found unknown container runtime: $Runtime
- 205 Please report at: https://github.com/mviereck/x11docker" ;;
- 206 esac
- 207 }
- 208 debugnote "dockerrc: Container Runtime: $Runtime"
- 209 storeinfo "runtime=$Runtime"
- 210
- 211 # Refresh images.list for x11docker-gui
- 212 docker images 2>>/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/container.log | grep -v REPOSITORY | awk '{print $1 ":" $2}' >>/home/ignacio/.cache/x11docker/docker.imagelist.sort
- 213 rmcr /home/ignacio/.cache/x11docker/docker.imagelist.sort
- 214 while read -r Line ; do
- 215 grep -q "<none>" <<<$Line || echo $Line >> /home/ignacio/.cache/x11docker/docker.imagelist
- 216 done < <(sort < /home/ignacio/.cache/x11docker/docker.imagelist.sort)
- 217 rm /home/ignacio/.cache/x11docker/docker.imagelist.sort
- 218
- 219 # Check if image rstudioxhost:verse is available locally
- 220 Dockerpull=no
- 221 grep -x -q 'rstudioxhost:verse' < /home/ignacio/.cache/x11docker/docker.imagelist || grep -x -q 'rstudioxhost:verse:latest' < /home/ignacio/.cache/x11docker/docker.imagelist || {
- 222 docker inspect rstudioxhost:verse >>/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/container.log 2>&1 || {
- 223 echo 'Image rstudioxhost:verse not found locally.' >&2
- 224 echo 'Do you want to pull it from docker hub?' >&2
- 225 askyesno && Dockerpull=yes || error "Image 'rstudioxhost:verse' not available locally and not pulled from docker hub."
- 226 }
- 227 }
- 228
- 229 rocknroll || exit 64
- 230
- 231 [ "$Dockerpull" = 'yes' ] && {
- 232 note "Pulling image 'rstudioxhost:verse' from docker hub"
- 233 docker pull rstudioxhost:verse 1>&2 || error "Pulling docker image 'rstudioxhost:verse' seems to have failed!"
- 234 }
- 235
- 236 rocknroll || exit 64
- 237
- 238 Inspect="$(docker inspect rstudioxhost:verse --format='{{.Config.Entrypoint}}{{.Config.Cmd}}[{{.Config.User}}][{{.Config.WorkingDir}}]')"
- 239
- 240 # Check CMD
- 241 [ -z "$Containercommand" ] && {
- 242 # extract image command from image if not given on cli
- 243 Containercommand="$(cut -d] -f2 <<< "$Inspect" | cut -d[ -f2)"
- 244 debugnote "dockerrc: Image CMD: $Containercommand"
- 245 echo "$Containercommand" | grep -q /x11docker/containerrc && error 'Recursion error: Found CMD /x11docker/containerrc in image.
- 246 Did you use docker commit with an x11docker container?
- 247 Please build new images with a Dockerfile instead of using docker commit,
- 248 or provide a different container command.'
- 249 }
- 250
- 251 # Check USER
- 252 Imageuser="$(cut -d[ -f4 <<< "$Inspect" | cut -d] -f1)"
- 253 debugnote "dockerrc: Image USER: $Imageuser"
- 254 [ "$Imageuser" ] && note "Found 'USER $Imageuser' in image.
- 255 If you want to run with user $Imageuser instead of host user ignacio,
- 256 than run with --user=RETAIN."
- 257 storeinfo containeruser="ignacio"
- 258
- 259 # Check ENTRYPOINT
- 260 Entrypoint="$(cut -d] -f1 <<< "$Inspect" | cut -d[ -f2)"
- 261 debugnote "dockerrc: Image ENTRYPOINT: $Entrypoint"
- 262 echo "$Entrypoint" | grep -qE 'tini|init|systemd' && {
- 263 note "There seems to be an init system in ENTRYPOINT of image:
- 264 $Entrypoint
- 265 Will disable it as x11docker already runs an init with option --tini.
- 266 To allow this ENTRYPOINT, run x11docker with option --init=none."
- 267 Entrypoint=
- 268 }
- 269
- 270 # Check WORKDIR
- 271 Workdir="$(cut -d[ -f5 <<< "$Inspect" | cut -d] -f1)"
- 272 debugnote "dockerrc: Image WORKDIR: $Workdir"
- 273 [ "$Workdir" ] && note "Found 'WORKDIR $Workdir' in image.
- 274 You can change it with option --workdir=DIR."
- 275
- 276 [ -z "$Containercommand$Entrypoint" ] && error 'No container command specified and no CMD or ENTRYPOINT found in image.'
- 277
- 278 ######## Create containerrc ########
- 279
- 280 { echo '#! /bin/sh'
- 281 echo ''
- 282 echo '# containerrc'
- 283 echo '# Created startscript for docker run used as container command.'
- 284 echo '# Runs as unprivileged user in container.'
- 285 echo ''
- 286 echo 'exec 6>&1 7>&2'
- 287 echo 'exec >>/x11docker/container.log 2>&1'
- 288 echo ''
- 289 echo 'mysleep ()
- 290 {
- 291 sleep "${1:-1}" 2> /dev/null || sleep 1
- 292 }'
- 293 echo 'rocknroll ()
- 294 {
- 295 [ -s "$Timetosaygoodbyefile" ] && return 1;
- 296 [ -e "$Timetosaygoodbyefile" ] || return 1;
- 297 return 0
- 298 }'
- 299 echo 'saygoodbye ()
- 300 {
- 301 debugnote "time to say goodbye ($*)";
- 302 [ -e "$Timetosaygoodbyefile" ] && echo timetosaygoodbye >> $Timetosaygoodbyefile;
- 303 [ -e "$Timetosaygoodbyefifo" ] && echo timetosaygoodbye >> $Timetosaygoodbyefifo
- 304 }'
- 305 echo 'storeinfo ()
- 306 {
- 307 [ -e "$Storeinfofile" ] || return 1;
- 308 case "${1:-}" in
- 309 dump)
- 310 grep "^${2:-}=" $Storeinfofile | sed "s/^${2:-}=//"
- 311 ;;
- 312 drop)
- 313 sed -i "/^${2:-}=/d" $Storeinfofile
- 314 ;;
- 315 test)
- 316 grep -q "^${2:-}=" $Storeinfofile
- 317 ;;
- 318 *)
- 319 debugnote "storeinfo(): ${1:-}";
- 320 grep -q "^$(echo "${1:-}" | cut -d= -f1)=" $Storeinfofile && {
- 321 sed -i "/^$(echo "${1:-}" | cut -d= -f1)=/d" $Storeinfofile
- 322 };
- 323 echo "${1:-}" >> $Storeinfofile
- 324 ;;
- 325 esac
- 326 }'
- 327 echo 'waitforlogentry ()
- 328 {
- 329 local Startzeit Uhrzeit Dauer Count=0 Schlaf;
- 330 local Errorkeys="${4:-}";
- 331 local Warten="${5:-60}";
- 332 Startzeit="$(date +%s ||:)";
- 333 Startzeit="${Startzeit:-0}";
- 334 [ "$Warten" = "infinity" ] && Warten=32000;
- 335 debugnote "waitforlogentry(): ${1:-}: Waiting for logentry \"${3:-}\" in $(basename ${2:-})";
- 336 while ! grep -q "${3:-}" < "${2:-}"; do
- 337 Count="$(( $Count + 1 ))";
- 338 Uhrzeit="$(date +%s ||:)";
- 339 Uhrzeit="${Uhrzeit:-0}";
- 340 Dauer="$(( $Uhrzeit - $Startzeit ))";
- 341 Schlaf="$(( $Count / 10 ))";
- 342 [ "$Schlaf" = "0" ] && Schlaf="0.5";
- 343 mysleep "$Schlaf";
- 344 [ "$Dauer" -gt "10" ] && debugnote "waitforlogentry(): ${1:-}: Waiting since ${Dauer}s for log entry \"${3:-}\" in $(basename ${2:-})";
- 345 [ "$Dauer" -gt "$Warten" ] && error "waitforlogentry(): ${1:-}: Timeout waiting for log entry \"${3:-}\" in $(basename ${2:-})
- 346 Last lines of logfile $(basename ${2:-}):
- 347 $(tail "${2:-}")";
- 348 [ "$Errorkeys" ] && grep -i -q -E "$Errorkeys" < "${2:-}" && error "waitforlogentry(): ${1:-}: Found error message in logfile.
- 349 Last lines of logfile $(basename ${2:-}):
- 350 $(tail "${2:-}")";
- 351 rocknroll || {
- 352 debugnote "waitforlogentry(): ${1:-}: Stopped waiting for ${3:-} in $(basename ${2:-}) due to terminating signal.";
- 353 return 1
- 354 };
- 355 done;
- 356 debugnote "waitforlogentry(): ${1:-}: Found log entry \"${3:-}\" in $(basename ${2:-}).";
- 357 return 0
- 358 }'
- 359 echo 'calculate() {'
- 360 echo ' LC_ALL=C printf %.3f\\n "$((10**9 * $@))e-9"'
- 361 echo '}'
- 362 echo '
- 363 warning() {
- 364 echo "$*:WARNING" | sed "s/\$/ /" >>$Messagefile
- 365 }
- 366 note() {
- 367 echo "$*:NOTE" | sed "s/\$/ /" >>$Messagefile
- 368 }
- 369 verbose() {
- 370 echo "$*:VERBOSE" | sed "s/\$/ /" >>$Messagefile
- 371 }
- 372 debugnote() {
- 373 echo "$*:DEBUGNOTE" | sed "s/\$/ /" >>$Messagefile
- 374 }
- 375 error() {
- 376 echo "$*:ERROR" | sed "s/\$/ /" >>$Messagefile
- 377 exit 64
- 378 }
- 379 stdout() {
- 380 echo "$*:STDOUT" | sed "s/\$/ /" >>$Messagefile
- 381 }'
- 382 echo 'Messagefile=/x11docker/message.fifo'
- 383 echo 'Storeinfofile=/x11docker/store.info'
- 384 echo 'Timetosaygoodbyefile=/x11docker/timetosaygoodbye'
- 385 echo ''
- 386 echo 'waitforlogentry containerrc $Storeinfofile containerrootrc=ready infinity'
- 387 echo 'debugnote "Running containerrc: Unprivileged user commands in container"'
- 388 echo ''
- 389 echo "Containercommand=\"$Containercommand\""
- 390 echo "Entrypoint=\"$Entrypoint\""
- 391 echo ''
- 392 echo 'verbose "containerrc: Container system:'
- 393 echo '$(cat /etc/os-release 2>&1 ||:)"'
- 394 echo ''
- 395 } >> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/containerrc
- 396 {
- 397 echo ''
- 398 echo '# USER and HOME'
- 399 echo 'Containeruser="$(storeinfo dump containeruser)"'
- 400 echo 'Containeruserhome="/fakehome/ignacio"'
- 401 echo 'export USER="$Containeruser"'
- 402 echo 'export HOME="$Containeruserhome"'
- 403 echo ''
- 404 echo '# XDG_RUNTIME_DIR'
- 405 echo 'Containeruseruid=$(id -u $Containeruser)'
- 406 echo 'export XDG_RUNTIME_DIR=/tmp/XDG_RUNTIME_DIR'
- 407 echo '[ -e /run/user/$Containeruseruid ] && ln -s /run/user/$Containeruseruid $XDG_RUNTIME_DIR || mkdir -p -m700 $XDG_RUNTIME_DIR'
- 408 echo ''
- 409 echo 'mkdir -p $Containeruserhome'
- 410 echo '# Copy files from /etc/skel into empty HOME'
- 411 echo '[ -d /etc/skel ] && [ -z "$(ls -A "/fakehome/ignacio" 2>/dev/null | grep -v gnupg)" ] && {'
- 412 echo ' debugnote "containerrc: HOME is empty. Copying from /etc/skel"'
- 413 echo ' cp -n -R /etc/skel/. $Containeruserhome'
- 414 echo ' :'
- 415 echo '} || {'
- 416 echo ' debugnote "containerrc: HOME not empty. Not copying from /etc/skel"'
- 417 echo '}'
- 418 echo ''
- 419 echo '# Create softlink to X unix socket'
- 420 echo '[ -e /tmp/.X11-unix/X0 ] || ln -s /X0 /tmp/.X11-unix'
- 421 echo ''
- 422 echo 'unset WAYLAND_DISPLAY'
- 423 echo ''
- 424 echo 'export XDG_SESSION_TYPE=x11'
- 425 echo ''
- 426 echo ''
- 427 echo 'bash --version >/dev/null 2>&1 && export SHELL=/bin/bash || export SHELL=/bin/sh'
- 428 echo 'export TERM=xterm'
- 429 echo 'storeinfo test locale && export LANG="$(storeinfo dump locale)"'
- 430 echo '[ -e "/usr/share/zoneinfo/America/Los_Angeles" ] || export TZ=UTC+08'
- 431 echo '[ "$(date -Ihours)" != "2019-11-15T07-08:00" ] && export TZ=UTC+08'
- 432 echo '[ "$DEBIAN_FRONTEND" = noninteractive ] && unset DEBIAN_FRONTEND && export DEBIAN_FRONTEND'
- 433 echo '[ "$DEBIAN_FRONTEND" = newt ] && unset DEBIAN_FRONTEND && export DEBIAN_FRONTEND'
- 434 echo '# container environment (--env)'
- 435 echo "export 'container=docker'"
- 436 echo "export 'XAUTHORITY=/x11docker/Xauthority.client'"
- 437 echo "export 'DISPLAY=:0'"
- 438 echo "export 'XDG_RUNTIME_DIR=/tmp/XDG_RUNTIME_DIR'"
- 439 echo ''
- 440 echo 'env >> /x11docker/container.environment'
- 441 echo 'verbose "Container environment:'
- 442 echo '$(env | sort)"'
- 443 echo ''
- 444 echo 'cd "$HOME"'
- 445 [ "$Workdir" ] && echo "[ -d \"$Workdir\" ] && cd \"$Workdir\" # WORKDIR in image"
- 446 echo ''
- 447 echo "debugnote \"containerrc: Running container command:
- 448 \$Dbus $Entrypoint $Containercommand
- 449 \""
- 450 echo ''
- 451 echo 'exec 1>&6 2>&7 6>&- 7>&-'
- 452 echo "$Exec \$Dbus $Entrypoint $Containercommand >>/x11docker/stdout 2>>/x11docker/stderr"
- 453 echo "storeinfo cmdexitcode=\$?"
- 454 } >> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/containerrc
- 455 ######## End of containerrc ########
- 456
- 457 # Write containerrc into x11docker.log
- 458 nl -ba >> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/x11docker.log < /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/containerrc
- 459
- 460 # Send signal to run X and wait for X to be ready
- 461 storeinfo readyforX=ready
- 462 waitforlogentry 'dockerrc' /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/xinit.log 'xinitrc is ready' 'xinit: giving up|unable to connect to X server|Connection refused|server error|Only console users are allowed'
- 463
- 464 rocknroll || exit 64
- 465
- 466
- 467 rocknroll || exit 64
- 468
- 469
- 470 #### run docker image ####
- 471 read Containerid < <(docker run --tty --rm --detach \
- 472 --name x11docker_X0_rstudioxhost-verse_30672295372 \
- 473 --user 738202:89939 \
- 474 --env USER=ignacio \
- 475 --userns host \
- 476 --cap-drop ALL \
- 477 --security-opt no-new-privileges \
- 478 --security-opt label=type:container_runtime_t \
- 479 --volume '/usr/bin/docker-init':'/usr/local/bin/tini':ro \
- 480 --tmpfs /run --tmpfs /run/lock \
- 481 --volume '/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share':'/x11docker':rw \
- 482 --volume '/tmp/.X11-unix/X0':'/X0':rw \
- 483 --workdir '/tmp' \
- 484 --entrypoint env \
- 485 --env 'container=docker' \
- 486 --env 'XAUTHORITY=/x11docker/Xauthority.client' \
- 487 --env 'DISPLAY=:0' \
- 488 --env 'XDG_RUNTIME_DIR=/tmp/XDG_RUNTIME_DIR' \
- 489 -- rstudioxhost:verse /usr/local/bin/tini -- /bin/sh - /x11docker/containerrc 2>>/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/container.log | rmcr)
- 490 ##########################
- 491
- 492
- 493 [ "$Containerid" ] || {
- 494 error "Startup of docker failed. Did not receive a container ID.
- 495
- 496 Last lines of container log:
- 497 $(rmcr < /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/container.log | tail)"
- 498 }
- 499 storeinfo containerid="$Containerid"
- 500 # Wait for container to be ready
- 501 for ((Count=1 ; Count<=40 ; Count++)); do
- 502 docker exec x11docker_X0_rstudioxhost-verse_30672295372 sh -c : 2>&1 | rmcr >>/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/container.log && { debugnote 'dockerrc: Container is up and running.' ; break ; } || debugnote "dockerrc: Container not ready on $Count. attempt, trying again."
- 503 rocknroll || exit 64
- 504 mysleep 0.1
- 505 done
- 506
- 507 # Wait for pid 1 in container
- 508 for ((Count=1 ; Count<=40 ; Count++)); do
- 509 Pid1pid="$(docker inspect --format '{{.State.Pid}}' x11docker_X0_rstudioxhost-verse_30672295372 2>>/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/container.log | rmcr)"
- 510 debugnote "dockerrc: $Count. check for PID 1: $Pid1pid"
- 511 checkpid "$Pid1pid" && break
- 512 rocknroll || exit 64
- 513 mysleep 0.1
- 514 done
- 515 storeinfo pid1pid="$Pid1pid"
- 516
- 517 # Get IP of container
- 518 Containerip="$(docker inspect --format '{{ .NetworkSettings.IPAddress }}' x11docker_X0_rstudioxhost-verse_30672295372 2>>/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/container.log)"
- 519 storeinfo containerip=$Containerip
- 520
- 521 # Check log for startup failure
- 522 Failure="$(rmcr < /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/container.log | grep -v grep | grep -E 'Error response from daemon|OCI runtime exec' ||:)"
- 523 [ "$Failure" ] && {
- 524 echo "$Failure" >>/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/container.log
- 525 error "Got error message from docker daemon:
- 526 $Failure
- 527
- 528 Last lines of logfile:
- 529 "
- 530 }
- 531
- 532 # copy containerrootrc inside of container to avoid possible noexec of host home.
- 533 docker exec --tty x11docker_X0_rstudioxhost-verse_30672295372 sh -c 'cp /x11docker/containerrootrc /tmp/containerrootrc ; chmod 644 /tmp/containerrootrc' 2>&1 | rmcr >>/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/container.log
- 534 # run container root setup. containerrc will wait until setup script is ready.
- 535 docker exec --tty -u root x11docker_X0_rstudioxhost-verse_30672295372 /bin/sh /tmp/containerrootrc 2>&1 | rmcr >>/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/container.log
- 536
- 537 storeinfo dockerrc=ready
- 538
- 539 [ "$Containerid" ] || [ "$Wmcontainerid" ] && {
- 540 # wait for signal of finish()
- 541 read Signal </home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/dockerrc.stopfifo
- 542 [ "$Signal" = "stop" ] && {
- 543 [ "$Containerid" ] && docker stop $Containerid >> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/container.log 2>&1 &
- 544 [ "$Wmcontainerid" ] && docker stop $Wmcontainerid >> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/container.log 2>&1 &
- 545 [ "$Dockerlogspid" ] && kill $Dockerlogspid >> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/container.log 2>&1 &
- 546 }
- 547 } & storepid $! dockerstopshell
- 548 exit 0
- x11docker[07:11:14,403]: Generated containerrootrc:
- 1 #! /bin/sh
- 2
- 3 # containerrootrc
- 4 # This Script is executed as root in container.
- 5 # - Create container user
- 6 # - Time zone
- 7 # - Install NVIDIA driver if requested
- 8 # - Set up init system services and DBus for --init=systemd|openrc|runit|sysvinit
- 9
- 10 # redirect output to have it available before 'docker logs' starts. --init=runit (void) would eat up the output at all for unknown reasons.
- 11 exec 1>>/x11docker/container.log 2>&1
- 12
- 13 storeinfo ()
- 14 {
- 15 [ -e "$Storeinfofile" ] || return 1;
- 16 case "${1:-}" in
- 17 dump)
- 18 grep "^${2:-}=" $Storeinfofile | sed "s/^${2:-}=//"
- 19 ;;
- 20 drop)
- 21 sed -i "/^${2:-}=/d" $Storeinfofile
- 22 ;;
- 23 test)
- 24 grep -q "^${2:-}=" $Storeinfofile
- 25 ;;
- 26 *)
- 27 debugnote "storeinfo(): ${1:-}";
- 28 grep -q "^$(echo "${1:-}" | cut -d= -f1)=" $Storeinfofile && {
- 29 sed -i "/^$(echo "${1:-}" | cut -d= -f1)=/d" $Storeinfofile
- 30 };
- 31 echo "${1:-}" >> $Storeinfofile
- 32 ;;
- 33 esac
- 34 }
- 35 rocknroll ()
- 36 {
- 37 [ -s "$Timetosaygoodbyefile" ] && return 1;
- 38 [ -e "$Timetosaygoodbyefile" ] || return 1;
- 39 return 0
- 40 }
- 41
- 42 warning() {
- 43 echo "$*:WARNING" | sed "s/\$/ /" >>$Messagefile
- 44 }
- 45 note() {
- 46 echo "$*:NOTE" | sed "s/\$/ /" >>$Messagefile
- 47 }
- 48 verbose() {
- 49 echo "$*:VERBOSE" | sed "s/\$/ /" >>$Messagefile
- 50 }
- 51 debugnote() {
- 52 echo "$*:DEBUGNOTE" | sed "s/\$/ /" >>$Messagefile
- 53 }
- 54 error() {
- 55 echo "$*:ERROR" | sed "s/\$/ /" >>$Messagefile
- 56 exit 64
- 57 }
- 58 stdout() {
- 59 echo "$*:STDOUT" | sed "s/\$/ /" >>$Messagefile
- 60 }
- 61 Messagefile=/x11docker/message.fifo
- 62 Storeinfofile='/x11docker/store.info'
- 63 Timetosaygoodbyefile=/x11docker/timetosaygoodbye
- 64
- 65 debugnote 'Running containerrootrc: Setup as root in container'
- 66
- 67 # Check type of libc
- 68 ldd --version 2>&1 | grep -q 'musl libc' && Containerlibc='musl'
- 69 ldd --version 2>&1 | grep -q -E 'GLIBC|GNU libc' && Containerlibc='glibc'
- 70 debugnote "containerrootrc: Container libc: $Containerlibc"
- 71
- 72 # Prepare X environment
- 73 # Create some system dirs with needed permissions
- 74 mkdir -v -p /var/lib/dbus /var/run/dbus
- 75 mkdir -v -p -m 1777 /tmp/.ICE-unix /tmp/.X11-unix /tmp/.font-unix
- 76 chmod -c 1777 /tmp/.ICE-unix /tmp/.X11-unix /tmp/.font-unix
- 77 export DISPLAY=:0 XAUTHORITY=/x11docker/Xauthority.client
- 78 [ -e /X0 ] && ln -s /X0 /tmp/.X11-unix/X0
- 79 ls -l /X0
- 80 ls -l /tmp/.X11-unix/X0
- 81
- 82 # Time zone
- 83 [ ! -d /usr/share/zoneinfo ] && [ "$Containerlibc" = "glibc" ] && {
- 84 mkdir -p /usr/share/zoneinfo/America
- 85 cp '/x11docker/libc.localtime' '/usr/share/zoneinfo/America/Los_Angeles'
- 86 }
- 87 [ -e '/usr/share/zoneinfo/America/Los_Angeles' ] && ln -f -s '/usr/share/zoneinfo/America/Los_Angeles' /etc/localtime
- 88
- 89 # Container system
- 90 Containersystem="$(grep '^ID=' /etc/os-release 2>/dev/null | cut -d= -f2 || echo 'unknown')"
- 91 verbose "Container system ID: $Containersystem"
- 92
- 93 # Environment variables
- 94 export 'container=docker'
- 95 export 'XAUTHORITY=/x11docker/Xauthority.client'
- 96 export 'DISPLAY=:0'
- 97 export 'XDG_RUNTIME_DIR=/tmp/XDG_RUNTIME_DIR'
- 98
- 99 # Check container user
- 100 Containeruser="$(storeinfo dump containeruser)"
- 101
- 102 mkdir -v -m 777 /fakehome
- 103 Containeruserhome='/fakehome/ignacio'
- 104
- 105 # Create user entry in /etc/passwd (and delete possibly existing same uid)
- 106 cat /etc/passwd | grep -v ':738202:' > /tmp/passwd
- 107
- 108 # Disable possible /etc/shadow passwords for other users
- 109 sed -i 's%:x:%:-:%' /tmp/passwd
- 110 echo 'ignacio:x:738202:89939:ignacio,,,:/fakehome/ignacio:/bin/sh' >> /tmp/passwd
- 111
- 112 rm /etc/passwd
- 113 mv /tmp/passwd /etc/passwd || warning 'Unable to change /etc/passwd. That may be a security risk.'
- 114
- 115 # Create password entry for container user in /etc/shadow
- 116 rm -v /etc/shadow || warning 'Cannot change /etc/shadow. That may be a security risk.'
- 117 echo "ignacio:sac19FwGGTx/A:17293:0:99999:7:::" > /etc/shadow
- 118 echo 'root:*:17219:0:99999:7:::' >> /etc/shadow
- 119
- 120 # Create user group entry (and delete possibly existing same gid)
- 121 cat /etc/group | grep -v ':89939:' > /tmp/group
- 122 echo "primarygroup:x:89939:" >> /tmp/group
- 123 mv /tmp/group /etc/group
- 124
- 125 # Create /etc/sudoers, delete /etc/sudoers.d. Overwrite possible sudo setups in image.
- 126 [ -e /etc/sudoers.d ] && rm -v -R /etc/sudoers.d
- 127 [ -e /etc/sudoers ] && rm -v /etc/sudoers
- 128 echo '# /etc/sudoers created by x11docker' > /etc/sudoers
- 129 echo 'root ALL=(ALL) ALL' >> /etc/sudoers
- 130
- 131 # Restrict PAM configuration of su and sudo
- 132 mkdir -p /etc/pam.d
- 133 [ -e /etc/pam.d/sudo ] && rm -v /etc/pam.d/sudo
- 134 case "$Containersystem" in
- 135 fedora)
- 136 echo '#%PAM-1.0' > /etc/pam.d/su
- 137 echo 'auth sufficient pam_rootok.so' >> /etc/pam.d/su
- 138 echo 'account sufficient pam_succeed_if.so uid = 0 use_uid quiet' >> /etc/pam.d/su
- 139 echo 'session include system-auth' >> /etc/pam.d/su
- 140 ;;
- 141 *)
- 142 echo '#%PAM-1.0' > /etc/pam.d/su
- 143 echo 'auth sufficient pam_rootok.so' >> /etc/pam.d/su # allow root to switch user without a password
- 144 echo '@include common-auth' >> /etc/pam.d/su
- 145 echo '@include common-account' >> /etc/pam.d/su
- 146 echo '@include common-session' >> /etc/pam.d/su
- 147 ;;
- 148 esac
- 149
- 150 # Set up container user groups
- 151 [ -e "$Containeruserhome" ] || {
- 152 # only create HOME here if capability CHOWN is allowed.
- 153 :>/tmp/chowntestfile
- 154 chown "$Containeruser" /tmp/chowntestfile && {
- 155 mkdir -v -p "$Containeruserhome"
- 156 chown "$Containeruser" "$Containeruserhome"
- 157 }
- 158 rm /tmp/chowntestfile
- 159 }
- 160
- 161 rocknroll || exit 64
- 162
- 163
- 164 # disable getty in inittab
- 165 [ -e /etc/inittab ] && sed -i 's/.*getty/##getty disabled by x11docker## \0/' /etc/inittab
- 166
- 167
- 168 rocknroll || exit 64
- 169
- 170 storeinfo containerrootrc=ready
- 171
- x11docker[07:11:14,416]: Generated xinitrc:
- 1 #! /bin/sh
- 2 disable_xhost ()
- 3 {
- 4 local Line=;
- 5 command -v xhost > /dev/null || {
- 6 warning "Command 'xhost' not found.
- 7 Can not check for possibly allowed network access to X.
- 8 Please install 'xhost'.";
- 9 return 1
- 10 };
- 11 xhost 2>&1 | tail -n +2 /dev/stdin | while read -r Line; do
- 12 debugnote "xhost: Removing entry $Line";
- 13 xhost -$Line;
- 14 done;
- 15 xhost -;
- 16 [ "$(xhost 2>&1 | wc -l)" -gt "1" ] && {
- 17 warning "Remaining xhost permissions found on display ${DISPLAY:-}
- 18 $(xhost 2>&1 )";
- 19 return 1
- 20 };
- 21 xhost 2>&1 | grep "access control disabled" && {
- 22 warning "Failed to restrict xhost permissions.
- 23 Access to display ${DISPLAY:-} is allowed for everyone.";
- 24 return 1
- 25 };
- 26 return 0
- 27 }
- 28 pspid ()
- 29 {
- 30 LC_ALL=C ps -p "${1:-}" 2> /dev/null | grep -v 'TIME'
- 31 }
- 32 rocknroll ()
- 33 {
- 34 [ -s "$Timetosaygoodbyefile" ] && return 1;
- 35 [ -e "$Timetosaygoodbyefile" ] || return 1;
- 36 return 0
- 37 }
- 38 storeinfo ()
- 39 {
- 40 [ -e "$Storeinfofile" ] || return 1;
- 41 case "${1:-}" in
- 42 dump)
- 43 grep "^${2:-}=" $Storeinfofile | sed "s/^${2:-}=//"
- 44 ;;
- 45 drop)
- 46 sed -i "/^${2:-}=/d" $Storeinfofile
- 47 ;;
- 48 test)
- 49 grep -q "^${2:-}=" $Storeinfofile
- 50 ;;
- 51 *)
- 52 debugnote "storeinfo(): ${1:-}";
- 53 grep -q "^$(echo "${1:-}" | cut -d= -f1)=" $Storeinfofile && {
- 54 sed -i "/^$(echo "${1:-}" | cut -d= -f1)=/d" $Storeinfofile
- 55 };
- 56 echo "${1:-}" >> $Storeinfofile
- 57 ;;
- 58 esac
- 59 }
- 60 storepid ()
- 61 {
- 62 case "${1:-}" in
- 63 dump)
- 64 grep -w "${2:-}" "$Storepidfile" | cut -d' ' -f1
- 65 ;;
- 66 test)
- 67 grep -q -w "${2:-}" "$Storepidfile"
- 68 ;;
- 69 *)
- 70 echo "${1:-NOPID}" "${2:-NONAME}" >> "$Storepidfile";
- 71 debugnote "storepid(): Stored pid '${1:-}' of '${2:-}': $(pspid ${1:-} ||:)"
- 72 ;;
- 73 esac
- 74 }
- 75
- 76 warning() {
- 77 echo "$*:WARNING" | sed "s/\$/ /" >>$Messagefile
- 78 }
- 79 note() {
- 80 echo "$*:NOTE" | sed "s/\$/ /" >>$Messagefile
- 81 }
- 82 verbose() {
- 83 echo "$*:VERBOSE" | sed "s/\$/ /" >>$Messagefile
- 84 }
- 85 debugnote() {
- 86 echo "$*:DEBUGNOTE" | sed "s/\$/ /" >>$Messagefile
- 87 }
- 88 error() {
- 89 echo "$*:ERROR" | sed "s/\$/ /" >>$Messagefile
- 90 exit 64
- 91 }
- 92 stdout() {
- 93 echo "$*:STDOUT" | sed "s/\$/ /" >>$Messagefile
- 94 }
- 95 getscreensize() {
- 96 CurrentXaxis="$(xrandr | grep primary | cut -d' ' -f4 | cut -dx -f1 )"
- 97 CurrentYaxis="$(xrandr | grep primary | cut -d' ' -f4 | cut -dx -f2 | cut -d+ -f1)"
- 98 }
- 99 checkscreensize() {
- 100 getscreensize
- 101 [ "$Xaxis" = "$CurrentXaxis" ] || return 1
- 102 [ "$Yaxis" = "$CurrentYaxis" ] || return 1
- 103 return 0
- 104 }
- 105 getprimary() {
- 106 xrandr | grep -q primary || xrandr --output $(xrandr | grep ' connected' | head -n1 | cut -d' ' -f1) --primary
- 107 echo $(xrandr | grep primary | cut -d' ' -f1)
- 108 }
- 109
- 110 Messagefile='/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/message.fifo'
- 111 Output="$(getprimary)"
- 112 Storeinfofile='/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/store.info'
- 113 Storepidfile='/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/store.pids'
- 114 Timetosaygoodbyefile='/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/timetosaygoodbye'
- 115
- 116 export PATH='/usr/local/buildtools/java/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games'
- 117 export DISPLAY=:0 XAUTHORITY=/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client XSOCKET=/tmp/.X11-unix/X0 XDG_RUNTIME_DIR=/run/user/738202
- 118
- 119 Cookie=''
- 120 Line=''
- 121 Var=''
- 122
- 123 debugnote 'Running xinitrc'
- 124
- 125 # background color
- 126
- 127 # create new XAUTHORITY cookies
- 128 :> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client
- 129
- 130 export XAUTHORITY=/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/Xauthority.host.0
- 131 xhost | grep -q 'SI:localuser:ignacio' || { xhost +SI:localuser:ignacio ; Xhostentry='yes' ; }
- 132
- 133 echo 'Requesting untrusted cookie from X server'
- 134 xauth -v -i -f /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client generate :0 . untrusted timeout 3600
- 135
- 136 [ -s '/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client' ] || {
- 137 [ 'untrusted' = 'untrusted' ] && note 'Could not create untrusted cookie.
- 138 Maybe your X server misses extension SECURITY.'
- 139 warning 'Memory access failures and rendering glitches
- 140 may occure due to unrestricted cookie.
- 141 Avoid them with isolation breaking option --hostipc,
- 142 or use another X server option like --xpra or --nxagent.'
- 143 [ 'untrusted' = 'untrusted' ] && warning 'SECURITY RISK! Keylogging and remote host control
- 144 may be possible! Better avoid using option --hostdisplay,
- 145 rather use --xpra or --nxagent.'
- 146 cp /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/Xauthority.host.0 /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client
- 147 }
- 148 [ -s '/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client' ] || {
- 149 # still no cookie? try to create one without extension security
- 150 debugnote 'xinitrc: Failed to retrieve trusted cookie from X server. Will bake one myself.'
- 151 echo 'Failed to retrieve trusted cookie from X server. Will bake one myself.'
- 152 xauth -v -i -f /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client add :0 . 9d970e38294143ff9d862ac7df0166ab
- 153 ls -l /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client
- 154 }
- 155
- 156 # Prepare cookie with localhost identification disabled by ffff, needed if X socket is shared. ffff means 'familiy wild'
- 157 Cookie="$(xauth -i -f /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client nlist | sed -e 's/^..../ffff/')"
- 158 echo "$Cookie" | xauth -v -i -f /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client nmerge -
- 159
- 160 debugnote "xinitrc: Created cookie: $(xauth -f /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client list 2>&1)"
- 161 ls -l /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client
- 162 cp /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/Xauthority.server
- 163 chmod 644 /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client
- 164
- 165 [ -s '/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client' ] || warning 'Cookie creation failed!'
- 166 [ '$Xhostentry' = 'yes' ] && env XAUTHORITY=/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/Xauthority.host.0 xhost -SI:localuser:ignacio
- 167 export XAUTHORITY=/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client
- 168 [ 'yes' = 'no' ] || [ ! -s '/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client' ] && unset XAUTHORITY && warning '--hostdisplay: X server :0 runs without cookie authentication.'
- 169
- 170 verbose "Output of xrandr on :0
- 171 $(xrandr)"
- 172
- 173 echo 'xinitrc: xinitrc is ready'
- 174 storeinfo xinitrc=ready
- 175
- 176 # wait for the end
- 177 read Var </home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/timetosaygoodbye.fifo
- DEBUGNOTE[07:11:14,441]: storepid(): Stored pid '115527' of 'containershell': 115527 pts/4 00:00:00 bash
- DEBUGNOTE[07:11:14,441]: Running xtermrc: Ask for password if needed (no)
- DEBUGNOTE[07:11:14,450]: waitforlogentry(): start_xserver(): Waiting for logentry "readyforX=ready" in store.info
- DEBUGNOTE[07:11:14,454]: Running dockerrc: Setup as root or as user docker on host.
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/container.log <==
- WARNING: No swap limit support
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/message.log <==
- DEBUGNOTE[07:11:14,530]: dockerrc: Found default Runtime: runc
- DEBUGNOTE[07:11:14,542]: dockerrc: All Runtimes: nvidia runc
- DEBUGNOTE[07:11:14,554]: dockerrc: Container Runtime: runc
- DEBUGNOTE[07:11:14,567]: storeinfo(): runtime=runc
- DEBUGNOTE[07:11:14,679]: dockerrc: Image CMD: /bin/sh -c /usr/lib/rstudio/bin/rstudio
- DEBUGNOTE[07:11:14,692]: dockerrc: Image USER: developer
- 1 #! /bin/sh
- 2
- 3 # containerrc
- 4 # Created startscript for docker run used as container command.
- 5 # Runs as unprivileged user in container.
- 6
- 7 exec 6>&1 7>&2
- 8 exec >>/x11docker/container.log 2>&1
- 9
- 10 mysleep ()
- 11 {
- 12 sleep "${1:-1}" 2> /dev/null || sleep 1
- 13 }
- 14 rocknroll ()
- 15 {
- 16 [ -s "$Timetosaygoodbyefile" ] && return 1;
- 17 [ -e "$Timetosaygoodbyefile" ] || return 1;
- 18 return 0
- 19 }
- 20 saygoodbye ()
- 21 {
- 22 debugnote "time to say goodbye ($*)";
- 23 [ -e "$Timetosaygoodbyefile" ] && echo timetosaygoodbye >> $Timetosaygoodbyefile;
- 24 [ -e "$Timetosaygoodbyefifo" ] && echo timetosaygoodbye >> $Timetosaygoodbyefifo
- 25 }
- 26 storeinfo ()
- 27 {
- 28 [ -e "$Storeinfofile" ] || return 1;
- 29 case "${1:-}" in
- 30 dump)
- 31 grep "^${2:-}=" $Storeinfofile | sed "s/^${2:-}=//"
- 32 ;;
- 33 drop)
- 34 sed -i "/^${2:-}=/d" $Storeinfofile
- 35 ;;
- 36 test)
- 37 grep -q "^${2:-}=" $Storeinfofile
- 38 ;;
- 39 *)
- 40 debugnote "storeinfo(): ${1:-}";
- 41 grep -q "^$(echo "${1:-}" | cut -d= -f1)=" $Storeinfofile && {
- 42 sed -i "/^$(echo "${1:-}" | cut -d= -f1)=/d" $Storeinfofile
- 43 };
- 44 echo "${1:-}" >> $Storeinfofile
- 45 ;;
- 46 esac
- 47 }
- 48 waitforlogentry ()
- 49 {
- 50 local Startzeit Uhrzeit Dauer Count=0 Schlaf;
- 51 local Errorkeys="${4:-}";
- 52 local Warten="${5:-60}";
- 53 Startzeit="$(date +%s ||:)";
- 54 Startzeit="${Startzeit:-0}";
- 55 [ "$Warten" = "infinity" ] && Warten=32000;
- 56 debugnote "waitforlogentry(): ${1:-}: Waiting for logentry \"${3:-}\" in $(basename ${2:-})";
- 57 while ! grep -q "${3:-}" < "${2:-}"; do
- 58 Count="$(( $Count + 1 ))";
- 59 Uhrzeit="$(date +%s ||:)";
- 60 Uhrzeit="${Uhrzeit:-0}";
- 61 Dauer="$(( $Uhrzeit - $Startzeit ))";
- 62 Schlaf="$(( $Count / 10 ))";
- 63 [ "$Schlaf" = "0" ] && Schlaf="0.5";
- 64 mysleep "$Schlaf";
- 65 [ "$Dauer" -gt "10" ] && debugnote "waitforlogentry(): ${1:-}: Waiting since ${Dauer}s for log entry \"${3:-}\" in $(basename ${2:-})";
- 66 [ "$Dauer" -gt "$Warten" ] && error "waitforlogentry(): ${1:-}: Timeout waiting for log entry \"${3:-}\" in $(basename ${2:-})
- 67 Last lines of logfile $(basename ${2:-}):
- 68 $(tail "${2:-}")";
- 69 [ "$Errorkeys" ] && grep -i -q -E "$Errorkeys" < "${2:-}" && error "waitforlogentry(): ${1:-}: Found error message in logfile.
- 70 Last lines of logfile $(basename ${2:-}):
- 71 $(tail "${2:-}")";
- 72 rocknroll || {
- 73 debugnote "waitforlogentry(): ${1:-}: Stopped waiting for ${3:-} in $(basename ${2:-}) due to terminating signal.";
- 74 return 1
- 75 };
- 76 done;
- 77 debugnote "waitforlogentry(): ${1:-}: Found log entry \"${3:-}\" in $(basename ${2:-}).";
- 78 return 0
- 79 }
- 80 calculate() {
- 81 LC_ALL=C printf %.3f\\n "$((10**9 * $@))e-9"
- 82 }
- 83
- 84 warning() {
- 85 echo "$*:WARNING" | sed "s/\$/ /" >>$Messagefile
- 86 }
- 87 note() {
- 88 echo "$*:NOTE" | sed "s/\$/ /" >>$Messagefile
- 89 }
- 90 verbose() {
- 91 echo "$*:VERBOSE" | sed "s/\$/ /" >>$Messagefile
- 92 }
- 93 debugnote() {
- 94 echo "$*:DEBUGNOTE" | sed "s/\$/ /" >>$Messagefile
- 95 }
- 96 error() {
- 97 echo "$*:ERROR" | sed "s/\$/ /" >>$Messagefile
- 98 exit 64
- 99 }
- 100 stdout() {
- 101 echo "$*:STDOUT" | sed "s/\$/ /" >>$Messagefile
- 102 }
- 103 Messagefile=/x11docker/message.fifo
- 104 Storeinfofile=/x11docker/store.info
- 105 Timetosaygoodbyefile=/x11docker/timetosaygoodbye
- 106
- 107 waitforlogentry containerrc $Storeinfofile containerrootrc=ready infinity
- 108 debugnote "Running containerrc: Unprivileged user commands in container"
- 109
- 110 Containercommand="/bin/sh -c /usr/lib/rstudio/bin/rstudio"
- 111 Entrypoint=""
- 112
- 113 verbose "containerrc: Container system:
- 114 $(cat /etc/os-release 2>&1 ||:)"
- 115
- 116
- 117 # USER and HOME
- 118 Containeruser="$(storeinfo dump containeruser)"
- 119 Containeruserhome="/fakehome/ignacio"
- 120 export USER="$Containeruser"
- 121 export HOME="$Containeruserhome"
- 122
- 123 # XDG_RUNTIME_DIR
- 124 Containeruseruid=$(id -u $Containeruser)
- 125 export XDG_RUNTIME_DIR=/tmp/XDG_RUNTIME_DIR
- 126 [ -e /run/user/$Containeruseruid ] && ln -s /run/user/$Containeruseruid $XDG_RUNTIME_DIR || mkdir -p -m700 $XDG_RUNTIME_DIR
- 127
- 128 mkdir -p $Containeruserhome
- 129 # Copy files from /etc/skel into empty HOME
- 130 [ -d /etc/skel ] && [ -z "$(ls -A "/fakehome/ignacio" 2>/dev/null | grep -v gnupg)" ] && {
- 131 debugnote "containerrc: HOME is empty. Copying from /etc/skel"
- 132 cp -n -R /etc/skel/. $Containeruserhome
- 133 :
- 134 } || {
- 135 debugnote "containerrc: HOME not empty. Not copying from /etc/skel"
- 136 }
- 137
- 138 # Create softlink to X unix socket
- 139 [ -e /tmp/.X11-unix/X0 ] || ln -s /X0 /tmp/.X11-unix
- 140
- 141 unset WAYLAND_DISPLAY
- 142
- 143 export XDG_SESSION_TYPE=x11
- 144
- 145
- 146 bash --version >/dev/null 2>&1 && export SHELL=/bin/bash || export SHELL=/bin/sh
- 147 export TERM=xterm
- 148 storeinfo test locale && export LANG="$(storeinfo dump locale)"
- 149 [ -e "/usr/share/zoneinfo/America/Los_Angeles" ] || export TZ=UTC+08
- 150 [ "$(date -Ihours)" != "2019-11-15T07-08:00" ] && export TZ=UTC+08
- 151 [ "$DEBIAN_FRONTEND" = noninteractive ] && unset DEBIAN_FRONTEND && export DEBIAN_FRONTEND
- 152 [ "$DEBIAN_FRONTEND" = newt ] && unset DEBIAN_FRONTEND && export DEBIAN_FRONTEND
- 153 # container environment (--env)
- 154 export 'container=docker'
- 155 export 'XAUTHORITY=/x11docker/Xauthority.client'
- 156 export 'DISPLAY=:0'
- 157 export 'XDG_RUNTIME_DIR=/tmp/XDG_RUNTIME_DIR'
- 158
- 159 env >> /x11docker/container.environment
- 160 verbose "Container environment:
- 161 $(env | sort)"
- 162
- 163 cd "$HOME"
- 164 [ -d "/home/developer" ] && cd "/home/developer" # WORKDIR in image
- 165
- 166 debugnote "containerrc: Running container command:
- 167 $Dbus /bin/sh -c /usr/lib/rstudio/bin/rstudio
- 168 "
- 169
- 170 exec 1>&6 2>&7 6>&- 7>&-
- 171 $Dbus /bin/sh -c /usr/lib/rstudio/bin/rstudio >>/x11docker/stdout 2>>/x11docker/stderr
- 172 storeinfo cmdexitcode=$?
- x11docker note: Found 'USER developer' in image.
- If you want to run with user developer instead of host user ignacio,
- than run with --user=RETAIN.
- DEBUGNOTE[07:11:14,722]: storeinfo(): containeruser=ignacio
- DEBUGNOTE[07:11:14,737]: dockerrc: Image ENTRYPOINT:
- DEBUGNOTE[07:11:14,751]: dockerrc: Image WORKDIR: /home/developer
- x11docker note: Found 'WORKDIR /home/developer' in image.
- You can change it with option --workdir=DIR.
- DEBUGNOTE[07:11:14,782]: storeinfo(): readyforX=ready
- DEBUGNOTE[07:11:14,798]: waitforlogentry(): dockerrc: Waiting for logentry "xinitrc is ready" in xinit.log
- DEBUGNOTE[07:11:14,968]: waitforlogentry(): start_xserver(): Found log entry "readyforX=ready" in store.info.
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/xinit.log <==
- Requesting untrusted cookie from X server
- Ignoring locks on authority file /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client
- authorization id is 1226
- Ignoring locks and writing authority file /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/message.log <==
- DEBUGNOTE[07:11:15,010]: Running xinitrc
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/xinit.log <==
- Ignoring locks on authority file /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client
- 1 entries read in: 0 new, 1 replacement
- Ignoring locks and writing authority file /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client
- -rw------- 1 ignacio primarygroup 75 Nov 15 07:11 /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client
- RandR extension missing
- xinitrc: xinitrc is ready
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/message.log <==
- DEBUGNOTE[07:11:15,033]: xinitrc: Created cookie: #ffff#6d617274696e657a69672e73666f2e636f72702e676f6f676c652e636f6d#:0 MIT-MAGIC-COOKIE-1 77b0ab70e70ccf844dca6415e5afeffa
- x11docker[07:11:15,054]: Output of xrandr on :0
- DEBUGNOTE[07:11:15,071]: storeinfo(): xinitrc=ready
- DEBUGNOTE[07:11:15,248]: waitforlogentry(): dockerrc: Found log entry "xinitrc is ready" in xinit.log.
- DEBUGNOTE[07:11:15,852]: storeinfo(): containerid=96b5d4ad5968bcfaa66c43837fbf75688af3399ff36ab02fa4accdb0bca97862
- DEBUGNOTE[07:11:15,864]: waitforlogentry(): containerrc: Waiting for logentry "containerrootrc=ready" in store.info
- DEBUGNOTE[07:11:16,037]: dockerrc: Container is up and running.
- DEBUGNOTE[07:11:16,083]: dockerrc: 1. check for PID 1: 116038
- DEBUGNOTE[07:11:16,093]: storeinfo(): pid1pid=116038
- DEBUGNOTE[07:11:16,138]: storeinfo(): containerip=192.168.9.2
- DEBUGNOTE[07:11:16,451]: Running containerrootrc: Setup as root in container
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/container.log <==
- mkdir: created directory '/var/lib/dbus'
- mkdir: created directory '/var/run/dbus'
- mkdir: created directory '/tmp/.ICE-unix'
- mkdir: created directory '/tmp/.X11-unix'
- mkdir: created directory '/tmp/.font-unix'
- srwxrwxrwx 1 root root 0 Nov 11 15:53 /X0
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/message.log <==
- DEBUGNOTE[07:11:16,468]: containerrootrc: Container libc: glibc
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/container.log <==
- lrwxrwxrwx 1 root root 3 Nov 15 15:11 /tmp/.X11-unix/X0 -> /X0
- mkdir: created directory '/fakehome'
- removed '/etc/shadow'
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/message.log <==
- x11docker[07:11:16,485]: Container system ID: ubuntu
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/container.log <==
- chown: changing ownership of '/tmp/chowntestfile': Operation not permitted
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/message.log <==
- DEBUGNOTE[07:11:16,504]: storeinfo(): containerrootrc=ready
- DEBUGNOTE[07:11:16,540]: storeinfo(): dockerrc=ready
- DEBUGNOTE[07:11:16,562]: storepid(): Stored pid '116579' of 'dockerstopshell': 116579 pts/4 00:00:00 bash
- DEBUGNOTE[07:11:16,566]: waitforlogentry(): start_docker(): Waiting for logentry "dockerrc=ready" in store.info
- DEBUGNOTE[07:11:16,573]: waitforlogentry(): start_docker(): Found log entry "dockerrc=ready" in store.info.
- DEBUGNOTE[07:11:16,573]: storeinfo(): xtermrc=ready
- DEBUGNOTE[07:11:16,579]: watchpidlist(): Setting pid 116038 on watchlist: pid1pid
- DEBUGNOTE[07:11:16,599]: watchpidlist(): Watching pids:
- 116038 pts/0 00:00:00 tini
- DEBUGNOTE[07:11:16,602]: storepid(): Stored pid '116038' of 'pid1pid': 116038 pts/0 00:00:00 tini
- DEBUGNOTE[07:11:16,691]: Process tree of container: (maybe not complete yet)
- tini(116038)---sh(116085)---sleep(116427)
- DEBUGNOTE[07:11:16,874]: Process tree of x11docker:
- bash(114404)-+-bash(114910)---tail(114912)
- |-bash(114913)---sleep(116448)
- |-bash(114914)---sleep(116452)
- |-bash(114934)
- |-bash(114947)
- |-bash(115527)---bash(116680)---pstree(116681)
- `-bash(115876)
- Lost child of dockerrc (dockerstopshell):
- bash(116579)
- DEBUGNOTE[07:11:16,880]: waitforlogentry(): containerrc: Found log entry "containerrootrc=ready" in store.info.
- DEBUGNOTE[07:11:16,881]: storeinfo(): Stored info:
- cache=/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372
- stdout=/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/stdout
- stderr=/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/stderr
- x11dockerpid=114404
- xserver=--hostdisplay
- DISPLAY=:0
- XAUTHORITY=/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client
- XSOCKET=/tmp/.X11-unix/X0
- XDG_RUNTIME_DIR=/run/user/738202
- Xenv= DISPLAY=:0 XAUTHORITY=/home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/Xauthority.client XSOCKET=/tmp/.X11-unix/X0 XDG_RUNTIME_DIR=/run/user/738202
- tini=/usr/bin/docker-init
- containername=x11docker_X0_rstudioxhost-verse_30672295372
- runtime=runc
- containeruser=ignacio
- readyforX=ready
- xinitrc=ready
- containerid=96b5d4ad5968bcfaa66c43837fbf75688af3399ff36ab02fa4accdb0bca97862
- pid1pid=116038
- containerip=192.168.9.2
- containerrootrc=ready
- dockerrc=ready
- xtermrc=ready
- DEBUGNOTE[07:11:16,886]: storepid(): Stored pids:
- 114934 watchpidlist
- 114947 watchmessagefifo
- 115527 containershell
- 116579 dockerstopshell
- 116038 pid1pid
- DEBUGNOTE[07:11:16,888]: storeinfo(): x11docker=ready
- DEBUGNOTE[07:11:16,890]: Running containerrc: Unprivileged user commands in container
- DEBUGNOTE[07:11:16,921]: waitforlogentry(): tailstdout: Found log entry "x11docker=ready" in store.info.
- DEBUGNOTE[07:11:16,923]: waitforlogentry(): tailstderr: Found log entry "x11docker=ready" in store.info.
- x11docker[07:11:16,930]: containerrc: Container system:
- NAME="Ubuntu"
- VERSION="18.04.3 LTS (Bionic Beaver)"
- ID=ubuntu
- ID_LIKE=debian
- PRETTY_NAME="Ubuntu 18.04.3 LTS"
- VERSION_ID="18.04"
- HOME_URL="https://www.ubuntu.com/"
- SUPPORT_URL="https://help.ubuntu.com/"
- BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
- PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
- VERSION_CODENAME=bionic
- UBUNTU_CODENAME=bionic
- DEBUGNOTE[07:11:16,941]: containerrc: HOME is empty. Copying from /etc/skel
- x11docker[07:11:16,988]: Container environment:
- container=docker
- DISPLAY=:0
- HOME=/fakehome/ignacio
- HOSTNAME=96b5d4ad5968
- LANG=en_US.UTF-8
- LC_ALL=en_US.UTF-8
- PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
- PWD=/tmp
- SHELL=/bin/bash
- TERM=xterm
- USER=ignacio
- XAUTHORITY=/x11docker/Xauthority.client
- XDG_RUNTIME_DIR=/tmp/XDG_RUNTIME_DIR
- XDG_SESSION_TYPE=x11
- DEBUGNOTE[07:11:17,007]: containerrc: Running container command:
- /bin/sh -c /usr/lib/rstudio/bin/rstudio
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/share/stderr <==
- qt.qpa.xcb: XKeyboard extension not present on the X server
- qt.qpa.xcb: xrender >= 0.5 required to create pixmap cursors
- The X11 connection broke (error 4). Did the X11 server die?
- ==> /home/ignacio/.cache/x11docker/rstudioxhost-verse-30672295372/message.log <==
- DEBUGNOTE[07:11:23,186]: storeinfo(): cmdexitcode=1
- DEBUGNOTE[07:11:23,605]: watchpidlist(): PID 116038 has terminated
- DEBUGNOTE[07:11:23,609]: time to say goodbye (watchpidlist 116038)
- DEBUGNOTE[07:11:23,615]: time to say goodbye (watchpidlist)
- DEBUGNOTE[07:11:23,616]: time to say goodbye (main)
- DEBUGNOTE[07:11:23,623]: Terminating x11docker.
- DEBUGNOTE[07:11:23,627]: time to say goodbye (finish)
- DEBUGNOTE[07:11:23,657]: finish(): Checking pid 116038 (pid1pid): (already gone)
- DEBUGNOTE[07:11:23,687]: finish(): Checking pid 116579 (dockerstopshell): 116579 pts/4 00:00:00 bash
- DEBUGNOTE[07:11:23,722]: finish(): Checking pid 115527 (containershell): (already gone)
- DEBUGNOTE[07:11:23,755]: finish(): Checking pid 114947 (watchmessagefifo): 114947 pts/4 00:00:00 bash
- DEBUGNOTE[07:11:23,790]: finish(): Checking pid 114934 (watchpidlist): (already gone)
- DEBUGNOTE[07:11:24,883]: termpid(): Terminating 114947 (watchmessagefifo): 114947 pts/4 00:00:00 bash
- DEBUGNOTE[07:11:25,012]: x11docker exit code: 0
- DEBUGNOTE[07:11:25,025]: CMD exit code: 1
Advertisement
Add Comment
Please, Sign In to add comment