Commit 39a2fb0d authored by Mathis Rosenhauer's avatar Mathis Rosenhauer

Print dots so remote script dies on disconnect

parent a6e732bc
......@@ -29,7 +29,7 @@
# OF THE POSSIBILITY OF SUCH DAMAGE.
#
#
# startvnc
# start-vnc
#
# This script is intended to be used on your local workstation running
# Ubuntu or Fedora Linux or macOS (tested). Other Unix flavors may
......@@ -47,7 +47,7 @@
# In case of problems contact Mathis Rosenhauer <rosenhauer@dkrz.de>.
#
set -eu
set -eufo pipefail
# Default settings
#
......@@ -125,7 +125,7 @@ clean_up () {
if [[ -n ${job_id:-} ]]; then
echo "Removing job ${job_id}."
ssh_frontend "scancel -Q ${job_id}; sleep 1; \
cd .startvnc && rm -f out.${job_id}"
rm -f .startvnc/out.${job_id}"
else
echo "Job ID not available. Make sure the vncjob is not running!"
ssh_frontend "squeue -u ${SVNC_USERNAME}"
......@@ -231,7 +231,7 @@ EOF
get_vnc_host_and_display () {
local job_id="$1"
ssh_frontend "/bin/bash" <<EOF
ssh_frontend "/bin/bash -s" <<EOF
logfile=\${HOME}/.startvnc/out.${job_id}
while [[ -z \${host_and_display} ]]; do
sleep 1
......@@ -239,7 +239,9 @@ while [[ -z \${host_and_display} ]]; do
host_and_display=\$(grep -Po "started on display \Kmg[0-9]+:[0-9]+" \
\${logfile})
fi
printf "." >&2
done
printf "\n" >&2
echo \${host_and_display}
EOF
}
......@@ -255,7 +257,7 @@ main () {
echo "Submitting vncserver job."
job_id=$(submit_vnc_job)
echo "Waiting for job ${job_id} to start."
printf "Waiting for job ${job_id} to start" >&2
local host_and_display=$(get_vnc_host_and_display "$job_id")
vnc_host=${host_and_display%:*}
vnc_display=${host_and_display#*:}
......
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