Lock files for VNC-based apps not being cleaned up

I looked into this for a while and it seems it’s an issue of how the user exists and if vncserver can clean it up itself. If I ‘logout’ of the vnc session, it cleans up. If I delete the session (have the scheduler delete the job) it removes the file.

Now I’m wondering how this works well for us. We do have a few files hanging about in tmp, but it’s unclear how to replicate this, for the most part the default behavour in the job script and vncserver works well for us. If the session dies, it generally removes the temp file for us. We’re running TurboVNC Server (Xvnc) 64-bit v2.1.90 (build 20180822), so we run a lower version than you

Looks like we have hooks like vnc_clean to override one liner given (vncserver -list | awk '/^:/{system("kill -0 "$2" 2>/dev/null || vncserver -kill "$1)}'). This runs both before the job runs and after it exists, so maybe before vncserver starts is the right place to find what you’re looking for.

Here’s where in your cluster.d file you could set it up so that it gets enabled on all your VNC related jobs.

v2:
  batch_connect:
      basic:
        script_wrapper: "module restore\n%s"
      vnc:
        script_wrapper: "module restore\nmodule load ondemand-vnc\n%s"
        vnc_clean: |
          # here you can do something more elaborate than what's given.