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

Re: [Condor-users] <Keyword>_HOOK_PREPARE_JOB usage

Thanks a lot, Ian. USR_JOB_WRAPPER configuration variable worked. I was able to write a wrapper script, set the environment variable there and then execute the job. It worked as expected. Thanks !


On Wed, Jun 20, 2012 at 1:31 PM, Kunal Rao <kunalgrao@xxxxxxxxx> wrote:
Okay, Thank ! I'll try that.


On Tue, Jun 19, 2012 at 5:03 PM, Ian Chesal <ichesal@xxxxxxxxxxxxxxxxxx> wrote:
On Tuesday, 19 June, 2012 at 4:58 PM, Kunal Rao wrote:

How to use the <Keyword>_HOOK_PREPARE_JOB mentioned on this page : http://research.cs.wisc.edu/condor/manual/v7.4/4_4Job_Hooks.html

to setup job environment before it is run ?

I'd like to use this hook to setup some environment variables before the job starts execution. How do I set it up ? Any sample configuration settings would be helpful.
This won't work for environment variable setup. From the documentation:

The condor_starter waits until this hook returns before attempting to execute the job. If the hook returns a non-zero exit status, the condor_starter will assume an error was reached while attempting to set up the job environment and abort the job.

The process exits, returns control to the parent process (condor_starter) before a new sub-process is spawned to run your actual job. So any environment changes made by the hook script won't be seen by then job.

Instead of a job hook, take a look at using a user job wrapper: http://research.cs.wisc.edu/condor/manual/v7.6/3_3Configuration.html#19134 

This will be the parent process of the job so any environment changes it makes will be seen by the job.

- Ian

Ian Chesal

Cycle Computing, LLC
Leader in Open Compute Solutions for Clouds, Servers, and Desktops
Enterprise Condor Support and Management Tools

Condor-users mailing list
To unsubscribe, send a message to condor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting

The archives can be found at: