I noticed this a while back as well, I just assumed it was more env variable cleanup/removal for reproducible research purposes. i.e. If you have a different env from the next submitter you get different results, so set the env to the minimum viable env.
I just started setting a PATH in my wrapper scripts and telling my users to do the same:
# Set a sane PATH. HTCondor can eat the default.
export PATH="${PATH:+${PATH}:}/bin:/usr/bin:/sbin:/usr/sbin"
This submission file will print the environment and exit, and my output results are below (err is empty as expected). You'll notice there's no PATH:
executable = /usr/bin/env
output = logs/out
error = logs/err
log = logs/condor_log
queue
And results:
_CONDOR_ANCESTOR_14582=16437:1742407785:660241318
_CONDOR_ANCESTOR_16437=614845:1750097658:297724199
_CONDOR_ANCESTOR_614845=614850:1750097658:3023395836
APPTAINER_CACHEDIR=/var/lib/condor/execute/dir_614845
BATCH_SYSTEM=HTCondor
CUBACORES=1
CUDA_VISIBLE_DEVICES=10000
GOMAXPROCS=1
GPU_DEVICE_ORDINAL=10000
JULIA_NUM_THREADS=1
MKL_NUM_THREADS=1
NUMEXPR_NUM_THREADS=1
NVIDIA_VISIBLE_DEVICES=none
OMP_NUM_THREADS=1
OMP_THREAD_LIMIT=1
OPENBLAS_NUM_THREADS=1
PYTHON_CPU_COUNT=1
ROOT_MAX_THREADS=1
SINGULARITY_CACHEDIR=/var/lib/condor/execute/dir_614845
TEMP=/tmp
TF_LOOP_PARALLEL_ITERATIONS=1
TF_NUM_THREADS=1
TMP=/tmp
TMPDIR=/tmp
_CHIRP_DELAYED_UPDATE_PREFIX=Chirp*
_CONDOR_AssignedGPUs=10000
_CONDOR_BIN=/usr/bin
_CONDOR_CHIRP_CONFIG=/var/lib/condor/execute/dir_614845/.chirp.config
_CONDOR_JOB_AD=/var/lib/condor/execute/dir_614845/.job.ad
_CONDOR_JOB_IWD=/cluster/home/mcgrewz/example_submit_scripts/basic
_CONDOR_JOB_PIDS=
_CONDOR_MACHINE_AD=/var/lib/condor/execute/dir_614845/.machine.ad
_CONDOR_SCRATCH_DIR=/var/lib/condor/execute/dir_614845
_CONDOR_SLOT=slot1_1
-Zach
________________________________________
From: HTCondor-users <htcondor-users-bounces@xxxxxxxxxxx> on behalf of Todd L Miller via HTCondor-users <htcondor-users@xxxxxxxxxxx>
Sent: Monday, June 16, 2025 11:06 AM
To: Marco Mambelli via HTCondor-users
Cc: Todd L Miller
Subject: Re: [HTCondor-users] Condor unsetting PATH and setting only variable and not environment
When submitting jobs they have PATH=/usr/local/bin:/usr/bin and no PATH
variable in the environment.
1. I don't know where the PATH is coming from
- The PATH of the user the job is running under is different
- This is at the beginning of my job
2. Why is only the variable set and not the environment?
- This causes problems with shell scripts because PATH is undefined in subprocesses (e.g. commands executed in the script)
I don't understand:
(a) PATH is definitionally the PATH variable in the environment. You
can't "have a PATH" if PATH isn't set in the environment. What are
you trying to say here?
(b) Given the questions, presumably you meant "When my jobs run," not
"When submitting jobs"?
Please send a submit file and shell script that demonstrate the
problem.
-- ToddM