Skip to content
Snippets Groups Projects
Commit 69b607b4 authored by Jafar Lie's avatar Jafar Lie
Browse files

updated slurm epilog for X clean up

Former-commit-id: 1cd81921
parent 34fa0bf0
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,24 @@ find /tmp -user ${SLURM_JOB_USER} -name ".esd-*" | xargs rm -rf
find /tmp -user ${SLURM_JOB_USER} -name ".X*-lock" | xargs rm -rf
find /tmp/.X11-unix -user ${SLURM_JOB_USER} -name "X*" | xargs rm -rf
# NOTE: 20180316 The jobs above clean up the VNC session
# further clean up for Strudel Session
# X lock files are owned by root, so we need to find the right files to delete
# New Strudel session will create a file under user's home folder called xorg-jobid
# This file contains the display number that is assigned to xterm when it starts
# Assigning variable and trimming the : from the display number
XSESSION=`cat /home/${SLURM_JOB_USER}/.vnc/xorg-${SLURM_JOB_ID} | tr -d :`
# Formatting the filenames for the two files that we need to clean: /tmp/.X*-lock and /tmp/.X11/X*
XLOCKFILENAME=".X"$XSESSION"-lock"
XUNIXFILENAME="X"$XSESSION
# Find the files and delete them
find /tmp/ -name $XLOCKFILENAME -exec rm -rf {} \;
find /tmp/.X11-unix -name $XUNIXFILENAME -exec rm -rf {} \;
# echo 1 to drop page cache
/bin/sync
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment