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

Re: [HTCondor-users] Expression in STARTD_NOCLAIM_SHUTDOWN?



On 12/12/2025 11:19 AM, Ram Ban wrote:
Hi all,
I am using STARTD_NOCLAIM_SHUTDOWN to stop machines when not used for 200 sec.
Now I have use case where I want this value to be max(uptime -1hr, 200sec) for vanilla universe.
Basically I want to keep machine up for alteast 1hr and then want to terminate if not used for 200 sec. Is there any way of doing this?

Thanks and regards 
Raman

Hi Raman,

STARTD_NOCLAIM_SHUTDOWN attempts to make the simple things simple, but there are other config knobs that give you more flexibility and the cost of complexity. Assuming your startd is configured with one partitionable slot (this is the default - you would need to go out of your way to get something different), then I think the below 2 config lines will do what you want.   One line tells the startd when to exit, and then the second line tells the master to exit when the startd exits.  You may want to consult the manual to read about the STARTD_LATCH_EXPRS knob and the DAEMON_SHUTDOWN knob.

Hope this helps,
Todd
# Tell the startd to shutdown when the partitionable slot
# says that NumDynamicSlots has been zero (i.e. no jobs) for more than 200 
# seconds, and the startd itself has been running for more than 1hr.
# Note: NumDynamicSlotsTime is published because by default 
# the knob SYSTEM_STARTD_LATCH_EXPRS = NumDynamicSlots

STARTD.DAEMON_SHUTDOWN = PartitionableSlot && \
	((CurrentTime - DaemonStartTime) > (60*60)) && \
	(NumDynamicSlots == 0) && \
	((CurrentTime - NumDynamicSlotsTime) > 200) 
#
# Shutdown the master if the startd exits.  Note that if
# STARTD_StartTime is zero, that the startd is not currently running.
#

MASTER.DAEMON_SHUTDOWN = (STARTD_StartTime =?= 0)