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

Re: [Condor-users] Only run when logged of?



On Wed, Sep 15, 2010 at 8:48 AM, Dave STREET <davey_street@xxxxxxxxxxx> wrote:
I am sure this is easy and I know some people do it, but how can I make it so windows machines only accept jobs and run jobs while no one is logged on, and remove jobs as soon as a user logs in? 

I can see how to set up for CPU and keyboard busy. But I want to have the logged on status of the machine control when jobs can and cant run? 

Aaron,

There isn't a built-in macro in Condor that indicates whether a user is logged in to a machine or not. But you could write something that can be called from a STARTD_CRON that returned True or False depending on whether users are logged in or not.

And then:

STARTD_CRON_JOBLIST = LOGINCHECKER
STARTD_CRON_LOGINCHECKER_PREFIX = LoginChecker
STARTD_CRON_LOGINCHECKER_EXECUTABLE = c:\condor\loginchecker.exe
STARTD_CRON_LOGINCHECKER_PERIOD = 1m
STARTD_CRON_LOGINCHECKER_MODE = Periodic
STARTD_CRON_LOGINCHECKER_RECONFIG = True

(That syntax is likely not 100% correct, I'm working from memory here on the cron syntax, but that should get you started)

The output from loginchecker.exe should be ClassAd attribute syntax. So:

UsersLoggedIn = (True|False)

That'll produce an attribute in your machine's ad called LoginCheckerUsersLoggedIn that you can reference in your START/SUSPEND/PREEMPT strings:

START = $(LoginCheckerUsersLoggedIn) =!= True

That should also keep START = False if the cron hasn't run and the attribute has never been set.

- Ian



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

http://www.cyclecomputing.com
http://www.cyclecloud.com