VNC desktop in apptainer: error in clean_up

We have a desktop app which runs in apptainer (batch_connect:template:vnc_container). When something goes wrong we always get this error `vncserver: command not found`.

This is not the real error but an error that happens in OOD’s clean_up function and distracts us from the real error.

clean_up () {
  echo "Cleaning up..."
  [[ -e "/data/leuven/355/vsc35586/.ondemand-quality/data/batch_connect/sys/desktop/output/2da0b388-5d2b-4bda-b2c8-075c72310e00/clean.sh" ]] && source "/data/leuven/355/vsc35586/.ondemand-quality/data/batch_connect/sys/desktop/output/2da0b388-5d2b-4bda-b2c8-075c72310e00/clean.sh"
  module load 

  apptainer exec instance://b5470e7a-e9b1-4ae8-beee-1e4e6a10805c vncserver -list | awk '/^:/{system("kill -0 "$2" 2>/dev/null || apptainer exec instance://b5470e7a-e9b1-4ae8-beee-1e4e6a10805c vncserver -kill "$1)}'
  [[ -n ${display} ]] && vncserver -kill :${display}
  apptainer instance stop b5470e7a-e9b1-4ae8-beee-1e4e6a10805c

  [[ ${SCRIPT_PID} ]] && pkill -P ${SCRIPT_PID} || :
  pkill -P $$
  exit ${1:-0}
}

In particular line [[ -n ${display} ]] && vncserver -kill :${display} fails: vncserver is only available in apptainer, not on the node.

Hello and welcome!

Thanks for catching this and letting us know. I’ve opened a bug for this in ood_core which you can follow here: `vnc_container` error in `clean_up` function · Issue #931 · OSC/ood_core · GitHub