Page History

Turn Off History

Known to work with version 8.2

If you want each machine that has the special software installed advertise its availability in its machine ClassAd, and you want to detect availability in your configuration, you can do this with STARTD Cron or (beginning with HTCondor Version 8.2, you can do this with a config script.

Lets say you want to use the attribute HAS_PYTHON in the STARTD, and you want to set it's value to true when the software is determined to be present. Then you would use the following configuration

STARTD_ATTRS = HAS_PYTHON $(STARTD_ATTRS)
include : $(LIBEXEC)/check_for_python.cmd |

The script must write lines in config syntax to stdout, so in bash check_for_python.cmd it might be written as

#!/bin/sh
# check for my python, and write config statements if we find it.
if [ -e /usr/bin/python ]; then echo HAS_PYTHON=true; fi

In Windows batch language the check_for_python.cmd script might be

@echo off
REM check the registry for python, and write config statements if we find it.
reg query HKLM\Software\Python\PythonCore\2.7\InstallPath /ve 2>NUL && echo HAS_PYTHON=true

Because the =check_for_python.cmd = script will be executed each time any HTCondor daemon starts or is reconfigured, and any time a HTCondor tool such as condor_status is run, you may want to configure the script to run only in the STARTD.

You can do this by wrapping the above configuration statements in an if block like this

if $(IsStartd)
  STARTD_ATTRS = HAS_PYTHON $(STARTD_ATTRS)
  include : $(LIBEXEC)/check_for_python.cmd |
endif