Skip to content

Commit

Permalink
Call websockify without full dependencies
Browse files Browse the repository at this point in the history
Also fix \
shell syntax.

The /usr/bin/websockify script uses python3-setuptools to check that
python3-numpy is present. But in fact that dependency is *optional*,
it is 2MB compressed, so we avoid it.

Also, composing the filesystem from various filesystem images and
symlinks, like the inst-sys does, confuses Python initialization quite a
bit, so thus the need for the seemingly superfluous PYTHONPATH.

Even with that PYTHONPATH, numpy is not found even if present, which is
another reason to avoid requiring it.
  • Loading branch information
mvidner committed Apr 6, 2018
1 parent ac56807 commit 368eb2b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions startup/common/vnc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ displayVNCMessage () {
echo
}

websockify() {
# this shortcut avoids requiring the optional numpy dependency
python3 -c 'import websockify.websocketproxy; websockify.websocketproxy.websockify_init()' "$@"
}

#----[ startVNCServer ]------#
startVNCServer () {
#---------------------------------------------------
Expand All @@ -87,10 +92,13 @@ startVNCServer () {
>/var/log/YaST2/vncserver.log 2>&1 &
xserver_pid=$!

/usr/bin/websockify \
# Python gets confused by the symlink games played in inst-sys
# so we must help it
export PYTHONPATH=`echo /usr/lib/python3*`/site-packages:$PYTHONPATH
websockify \
--web /usr/share/novnc \
5801 \
localhost:5901
localhost:5901 \
>/var/log/YaST2/websockify.log 2>&1 &

export DISPLAY=:0
Expand Down

0 comments on commit 368eb2b

Please sign in to comment.