Thanks!

I'm probably missing something basic, but I don't see any difference by 
applying the changes you suggest - the signals does still not seem to be 
effectuated until after the grace time is over.


Could it be something wrong with how my partitions are defined?


PartitionName=cheap Nodes=ALL Priority=1 PreemptMode=CANCEL GraceTime=40 
Default=YES MaxTime=INFINITE State=UP:
PartitionName=paid_jobs Nodes=ALL Priority=1000 PreemptMode=OFF Default=YES 
MaxTime=INFINITE State=UP:


Thanks again for hinting me about this - SHOULD have resolved my issues!

/jon

On 9 October 2017 at 14:01:20 +02:00, Bjørn-Helge Mevik <b.h.me...@usit.uio.no> 
wrote:

> <<teg...@renget.se>> writes:
> 
> 
> > trap 'sig_cont' SIGCONT
> > trap 'sig_term' SIGTERM
> > trap 'sig_kill' SIGKILL
> > sleep 400
> > 
> Note that this test might be affected by the fact that bash will _not_
> abort the "sleep 400"; it will wait until it has finished before
> executing the trap function(!) From man bash:
> 
> If bash is waiting for a command to complete and receives a signal for
> which a trap has been set, the trap will not be executed until the com‐
> mand completes. When bash is waiting for an asynchronous command via
> the wait builtin, the reception of a signal for which a trap has been
> set will cause the wait builtin to return immediately with an exit sta‐
> tus greater than 128, immediately after which the trap is executed.
> 
> Thus, if you do
> 
> sleep 400 &
> wait
> 
> instead, the trap function will be called as soon as the signal
> arrives. I got bit by this behaviour trying to do exactly the same that
> you did. :)
> 
> -- 
> Regards,
> Bjørn-Helge Mevik, dr. scient,
> Department for Research Computing, University of Oslo
>

Reply via email to