-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathxsession
More file actions
38 lines (31 loc) · 1.19 KB
/
xsession
File metadata and controls
38 lines (31 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# -*- mode: shell-script; coding: utf-8 -*-
#
# Copyright 2002-2014 Cendio AB.
# For more information, see http://www.cendio.com
# Identify where we are running (like "lab-210.lkpg.cendio.se")
CURRENT_HOST=$(hostname)
# Look for the configuration file specific to THIS node
# expected: ~/.thinlinc/session_config.lab-210.lkpg.cendio.se
CONFIG_FILE="$HOME/.thinlinc/.ood-secrets/session_config.${CURRENT_HOST}"
if [ -f "$CONFIG_FILE" ]; then
source "$CONFIG_FILE"
else
echo "No OOD session conf found" >&2
exit 1
fi
# Check if there is an active ThinLinc job
if ! squeue -u "$USER" -w "$OOD_JOB_NODE" -h -o %j | grep -q "thinlinc"; then
echo "No active ThinLinc jobs found for user $USER on this node."
exit 1
fi
# Set language on Debian based systems
if [ -r /etc/default/locale ]; then
source /etc/default/locale
export LANG LANGUAGE LC_NUMERIC LC_TIME LC_MONETARY LC_PAPER
export LC_IDENTIFICATION LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
fi
# Log system/distribution information
source ${TLPREFIX}/libexec/log_sysinfo.sh
# Source the startup scripts with an srun wrapper
srun --jobid=${OOD_JOB_ID} /bin/bash -c "source '${TLPREFIX}/etc/xstartup.default'"