Commit 6ddb72e5 authored by Mathis Rosenhauer's avatar Mathis Rosenhauer

Put ssh socket into unique subdir

parent d1ba5be3
......@@ -55,12 +55,13 @@ clean_up () {
ssh_mistral "squeue -u ${SVNC_USERNAME}"
fi
if [[ ${tmp_files} ]]; then
if [[ -n ${tmp_files} ]]; then
ssh_mistral "cd .startvnc && rm -f ${tmp_files}"
fi
if [[ ${SVNC_SSH_MUX} = "true" ]]; then
ssh_mistral "" "-O exit"
rmdir "${ssh_socket_dir}"
fi
# Remove local vnc PasswordFile
......@@ -79,7 +80,7 @@ usage () {
ssh_mistral () {
local ssh_options="$2 -o ForwardX11=no"
if [[ ${SVNC_SSH_MUX} = "true" ]]; then
ssh_options+=" -o ControlPath=~/.ssh/control:%h:%p:%r"
ssh_options+=" -o ControlPath=${ssh_socket_dir}/control:%h:%p:%r"
fi
ssh ${ssh_options} "${SVNC_USERNAME}@mistral00.dkrz.de" "$1"
}
......@@ -159,12 +160,12 @@ get_vnc_host_and_display () {
local job_id="$1"
ssh_mistral "cat > .startvnc/gethost.${job_id}" <<EOF
#!/bin/bash
LOGFILE=\${HOME}/.startvnc/out.${job_id}
logfile=\${HOME}/.startvnc/out.${job_id}
while [[ -z \${host_and_display} ]]; do
sleep 1
if [[ -f \${LOGFILE} ]]; then
if [[ -f \${logfile} ]]; then
host_and_display=\$(grep -Po "started on display \Kmg[0-9]+:[0-9]+" \
\${LOGFILE})
\${logfile})
fi
done
echo \${host_and_display}
......@@ -177,6 +178,7 @@ main () {
trap clean_up INT QUIT TERM ERR EXIT
if [[ ${SVNC_SSH_MUX} = "true" ]]; then
ssh_socket_dir=$(mktemp -d "${HOME}/.ssh/socket.XXXXX")
ssh_mistral "" "-MNf"
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment