I have an idea how to make one OS image that can be used for Torque, HTCondor, and Slurm such that we can have HTCondor jobs glidein to the Slurm cluster. First we employ /etc/sysconfig/condor. If this file sets CONDOR_CONFIG to a config file that sets START_MASTER = False, then HTCondor will not start. If it sets CONDOR_CONFIG to /etc/condor/condor_config or isn't set at all, then HTCondor will start normally. Next we change the LOCAL_CONFIG_FILE in /etc/condor/condor_config to /var/run/condor/condor_config.local which can be modified locally on the diskless host. This allows the Slurm pilot job to create this config file with the DAEMON_SHUTDOWN rules.
Now a special pilot job can be submitted to the Slurm cluster that starts an HTCondor startd, by running /usr/sbin/condor_master -f, and therefore makes the node into an HTCondor execution host. This works because the OS is configured as an execution host for HTCondor as well as Slurm (and Torque probably) even though it doesn't start HTCondor on boot. This way when the pilot job starts condor_master which starts condor_startd, the node announces itself as an execution host to the central manager. When there are no more HTCondor jobs to run, the startd will exit then the master will exit, then the Slurm pilot job will do some cleanup and exit, and the will go back to being just a Slurm node.
CONDOR_CONFIG
The condor_startd reads the CONDOR_CONFIG environment variable if it exists, to find its config file instead of the default /etc/condor/condor_config and exits with an error if there is a problem reading that file.
...
The condor.service unit in systemd reads /etc/sysconfig/condor but does not evaluate it. So adding something like the following to /etc/sysconfig/condor won't work, besides this would cause HTCondor to fail if that file didn't exist and that isn't what I want.
CONDOR_CONFIG=$(cat /var/run/condor/config)
...
/etc/sysconfig/pbs_mom: PBS_ARGS="-h"
/etc/sysconfig/slurmslurmd: SLURMD_OPTIONS="-h"
/etc/sysconfig/condor: CONDOR_CONFIG=/dontstartcondor/etc/condor/condor_off
Where /etc/condor/condor_off is a copy of /etc/condor/condor_config with LOCAL_CONFIG_DIR commented out and START_MASTER = False added.
If any of these schedulers are wanted to start on boot, the appropriate /etc/sysconfig file (pbs_mom, slurm, condor) will be altered via a snapshot.
/etc/sysconfig/pbs_mom: PBS_ARGS=""
/etc/sysconfig/slurmslurmd: SLURMD_OPTIONS="--conf-server testpost-serv-1"
/etc/sysconfig/condor: CONDOR_CONFIG=/etc/condor/condor_config
...