[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] Using Environment Variables in Startd Cron



Startd cron works just fine with multiple environment variables, but you want to enclose the value in "" in order to have it treat space as a separator, like this:
 
STARTD_CRON_FOO_EXECUTABLE=./foo.sh
STARTD_CRON_FOO_ARGS=-a 1 -b 2 -c 3
STARTD_CRON_FOO_ENV="VAR1=/foo VAR2=/bar"

Your problem is that when you use the environment tunneling method of setting config, then the shell gets involved and messes with quotes so that the HTCondor config system never sees them. In order for HTCondor to parse this correctly, it needs to SEE the enclosing double quotes, in which case it will treat space as a separator. 

In the absence of enclosing double quotes, it reverts to the old V1 rules, which use | or \n as a separator.  So I think this would work

export _condor_STARTD_CRON_FOO_ENV='VAR1=/foo|VAR2=/bar'

or maybe this (both single and double quotes so that the double quotes are preserved)

export _condor_STARTD_CRON_FOO_ENV='"VAR1=/foo VAR2=/bar"'

-tj

-----Original Message-----
From: HTCondor-users [mailto:htcondor-users-bounces@xxxxxxxxxxx] On Behalf Of hskarlupka
Sent: Tuesday, February 20, 2018 11:50 AM
To: HTCondor Users Mailinglist <htcondor-users@xxxxxxxxxxx>
Subject: [HTCondor-users] Using Environment Variables in Startd Cron

Hello,

I'm running some startd cron jobs to create a couple of additional 
classads. More recently I had to start adding environment variables. I 
noticed that startd cron doesn't work well with multiple variables. It 
instead squashes the list of variables down to just one variable where 
the key is equal to the first variable name and the value is equal to 
the rest of the text. Here is an example of how I set it up and the 
output I see:


export _condor_STARTD_CRON_FOO_EXECUTABLE='./foo.sh'
export _condor_STARTD_CRON_FOO_ARGS='-a 1 -b 2 -c 3'
export _condor_STARTD_CRON_FOO_ENV='VAR1=/foo VAR2=/bar'

When the job executes the environment only shows VAR1 and has it set to 
"/foo VAR2=/bar". The HTCondor docs show spaces between variables. Is 
there another special character I should be using? Thank you for the info!

Heath

_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/