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

Re: [HTCondor-users] Dynamically remove machine classAD

If your script produces no output, Condor keeps the attributes set by its previous execution. This is to handle the case where the script fails to execute properly sometimes. To tell Condor that the script is executing properly and wants to remove all previously-printed attributes, the script should print a line with a single '-' (dash).

 - Jaime

> On Feb 28, 2020, at 1:24 AM, Vikrant Aggarwal <ervikrant06@xxxxxxxxx> wrote:
> Hello Experts,
> I have a query regarding dynamic classADs. To populate the machine classAD following CRON is added, it's working fine to add classAD as soon as any file starting with team_ is appearing in /spare/conda/team-classads directory. But once I remove the file still machine classAD remains. To remove the classAD I have to delete the CONDATEST cron and do condor_reconfig. How can we dynamically delete the classADs like we can add them?
> STARTD_CRON_CONDATEST_EXECUTABLE = /var/tmp/condor_condatest_classads.sh
> cat /var/tmp/condor_condatest_classads.sh
> #!/bin/bash
> # Executed by Condor to periodically set custom class ad attributes
> exec 2>/dev/null
> team_classad_path="/spare/conda/team-classads"
> if [[ -d "$team_classad_path" ]]; then
>         for each_team_file in "$team_classad_path"/* ; do
>                 each_team_file_name=${each_team_file##*/}
>                 if [[ $each_team_file_name =~ ^team_* ]]; then
>                         read content < $each_team_file
>                         echo "$each_team_file_name = \"${content:-0}\""
>                 fi
>         done
> fi
> Addition/remove works with another script which is included using "include command: <SCRIPT>" before START condition but I want to manage this configuration separatedly and don't want to include new script before START conditions of machine.
> Thanks & Regards,
> Vikrant Aggarwal