/usr/lib/condor/libexec/condor_ssh_to_job_shell_setup is in htcondor 8.6.8~dfsg.1-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 39 40 41 42 43 44 45 46 47 | #!/bin/bash
# Make sure at least kill and grep are in path on various systems
PATH=$PATH:/bin:/usr/bin
# set up the environment that was saved by sshd_setup
if [ "$1" != "" ]; then
. "$1"
fi
# go to the job's working directory
for dir in "${_CONDOR_JOB_IWD}" "${_CONDOR_SCRATCH_DIR}"; do
if cd "${dir}"; then
break
fi
done
# kill the dummy sleep job if this is an interactive job
if grep -q '^InteractiveJob = true' "${_CONDOR_SCRATCH_DIR}/.job.ad"; then
if [ "${_CONDOR_JOB_PIDS}" != "" ]; then
kill "${_CONDOR_JOB_PIDS}" 2>/dev/null
_CONDOR_JOB_PIDS=""
fi
fi
if [ "${SSH_ORIGINAL_COMMAND}" != "" ]; then
# run the command specified by the user
eval ${SSH_ORIGINAL_COMMAND}
else
if [ "${_CONDOR_SLOT_NAME}" != "" ]; then
echo "Welcome to ${_CONDOR_SLOT_NAME}"'!'
fi
if [ "${_CONDOR_JOB_PIDS}" != "" ]; then
echo "Your condor job is running with pid(s) ${_CONDOR_JOB_PIDS}."
fi
if [ "${TMOUT}" != "" ]; then
echo "You will be logged out after ${TMOUT} seconds of inactivity."
fi
# start a shell for the user
if [ "${_CONDOR_SHELL}" != "" ]; then
# use the shell preferred by the user
exec -l "${_CONDOR_SHELL}"
fi
exec -l "${SHELL}"
fi
|