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

Re: [HTCondor-users] Is it possible to change on the fly the value of a configuration variable using the python function send_comand( ) ?



Hi Jose,

send_command allow various actions to be sent to a remote daemon (think âreconfigâ, âonâ, âoffâ, ârestartâ, etc).  Itâs actually quite tricky to use because the various commands available tend to be under-documented.  I copy the valid commands below*.

For example, to tell a master to kill a schedd, you might do:

htcondor.send_command(master_ad, htcondor.DaemonCommands.DaemonOff, âSCHEDDâ)

On the other hand, to tell the schedd directly, you might do:

htcondor.send_command(schedd_ad, htcondor.DaemonCommands.OffGraceful)

Of course, based on your question, none of this is probably what you want.  Instead, you want to look at the RemoteParam class.  This represents the parameter settings of a remote daemon.

For example, you might have a script that looks like this:

coll = htcondor.Collector()
schedd_ad = coll.locate(htcondor.DaemonTypes.Schedd, âfoo.example.comâ)
schedd_param = htcondor.RemoteParam(schedd_ad)
print schedd_param.get(âFOOâ, âbarâ)
schedd_param[âFOOâ] = âbazâ

Of course, you need to have appropriate security configuration setup to make runtime configuration changes.  Judging by recent messages to this list from Dmitri and Iain, there might be a bug somewhere on the daemon-side. YMMV.

Hope this helps,

Brian

* ['DaemonOff', 'DaemonOffFast', 'DaemonOffPeaceful', 'DaemonsOff', 'DaemonsOffFast', 'DaemonsOffPeaceful', 'OffFast', 'OffForce', 'OffGraceful', 'OffPeaceful', 'Reconfig', 'Restart', 'RestartPeacful', 'SetForceShutdown', âSetPeacefulShutdownâ]

> On Aug 5, 2015, at 3:07 PM, Jose Caballero <jcaballero.hep@xxxxxxxxx> wrote:
> 
> Hi,
> 
> I was just wondering if one can run command  condor_config_val -set
> "<var> = <value>" via the python binding function send_command( ).
> Or maybe I am misinterpreting the meaning and purpose of send_comand( ) ???
> 
> Cheers,
> Jose
> _______________________________________________
> 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/