Ws.log permission issue Websockify on VDI Desktop

New install and there is an issue with websockify.

It appears that websockify writes it’s log to /tmp/ws.log. It is written as owned by the user who submitted the request and it is not cleaned up after the job is complete. When user2 starts a VDI websockify fails due to permission issue. Did I miss something in the configuration so each user has their own ws.log?

output.log

Setting VNC password…
Starting VNC server…

WARNING: u126.unity:1 is taken because of /tmp/.X11-unix/X1
Remove this file if there is no X server u126.unity:1

WARNING: u126.unity:4 is taken because of /tmp/.X11-unix/X4
Remove this file if there is no X server u126.unity:4
Killing Xvnc process ID 162743
Xvnc process ID 162743 already killed
Xvnc did not appear to shut down cleanly. Removing /tmp/.X11-unix/X1
Killing Xvnc process ID 167902
Xvnc process ID 167902 already killed
Xvnc did not appear to shut down cleanly. Removing /tmp/.X11-unix/X4

Desktop ‘TurboVNC: u126.unity:1 (stewart.358)’ started on display u126.unity:1

Log file is vnc.log
Successfully started VNC server on u126.unity:5901…
Script starting…
Starting websocket server…
The system default contains no modules
(env var: LMOD_SYSTEM_DEFAULT_MODULES is empty)
No changes in loaded modules

Launching desktop ‘xfce’…
Traceback (most recent call last):
File “/usr/bin/websockify”, line 9, in
load_entry_point(‘websockify==0.8.0’, ‘console_scripts’, ‘websockify’)()
File “/usr/lib/python2.7/site-packages/websockify/websocketproxy.py”, line 423, in websockify_init
handler = logging.FileHandler(opts.log_file)
File “/usr/lib64/python2.7/logging/init.py”, line 902, in init
StreamHandler.init(self, self._open())
File “/usr/lib64/python2.7/logging/init.py”, line 925, in _open
stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: ‘/tmp/ws.log’
Scanning VNC log file for user authentications…
Generating connection YAML file…
generating cookie with syscall
generating cookie with syscall
generating cookie with syscall
generating cookie with syscall

(xfwm4:35517): xfwm4-WARNING **: 11:03:57.883: Error opening /dev/dri/card0: Permission denied

(xfsettingsd:35520): xfsettingsd-WARNING **: 11:03:57.938: Unknown mode ‘1885x1166 @ 60.0’ for output VNC-0, aborting.
SELinux Troubleshooter: Applet requires SELinux be enabled to run.

We use the websockify that novnc ships with which is 0.9.0. I don’t think that version even logs by defualt but has the option to.

We’re currently using noVNC module versioned at v0.6.0 which by now is quite old.

Using:

python-websockify-0.8.0-1.el7.noarch : WSGI based adapter for the Websockets protocol
Repo : @ondemand-compute
Matched from:
Filename : /usr/bin/websockify

Where do you have noVNC installed?

We use a module for noVNC and set the WEBSOCKIFY_CMD environment variable to the run inside that location.

setenv("WEBSOCKIFY_CMD","/usr/local/novnc/1.0.0/utils/websockify/run")

Can you find your noVNC installation and try to do the same?

This is working now.

I installed /usr/local/websockify/0.9.0
I’ve made a module websockify in that location.

I also did a setenv(“WEBSOCKIFY_CMD”,"/usr/local/websockify/0.9.0/run") in my module.

All is good now.