<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div>Hello,<br></div><div><br data-mce-bogus="1"></div><div>I'm using slurm version 19.05.2 on debian 10.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>I'm try to hand a SIGINT signal by a child process of a batch.</div><div>The signal is automatically send 30 s before the end of time. </div><div>You can see this mechanism in this minimal example:<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>---------------------------------------</div><div><em><span style="text-decoration: underline;" data-mce-style="text-decoration: underline;">test.slurm:</span></em><br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>#!/bin/bash<br>#SBATCH --job-name=test<br>#SBATCH --ntasks-per-node=1<br>#SBATCH --nodes=1<br>#SBATCH --time=00:03:00<br>#SBATCH --signal=B:SIGINT@30<br><br><strong># This example works, but I need it to work without "B:" in --signal options, <span class="tlid-translation translation" lang="en"><span title="" class="">so I want test.sh receives the SIGINT signal and not test.slurm</span></span></strong></div><div><br>sig_handler()<br>{<br> echo "BATCH interrupted"<br> exit 2<br>}<br><br>trap 'sig_handler' SIGINT<br><br>/home/user/test.sh &<br><br>wait<br>---------------------------------------<br><em><span style="text-decoration: underline;" data-mce-style="text-decoration: underline;">test.sh:</span></em><br><br>#!/bin/bash<br><br>function sig_handler()<br>{<br> echo "Executable interrupted"<br> exit 2<br>}<br><br>trap 'sig_handler' SIGINT<br><br>echo "BEGIN"<br>sleep 200<br>echo "END"</div><div>---------------------------------------</div><div data-marker="__SIG_PRE__"><div><br data-mce-bogus="1"></div><div>Unfortunately, when I use in test.slurm:<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>#SBATCH --signal=SIGINT@30</div><div><br data-mce-bogus="1"></div><span class="tlid-translation translation" lang="en"><span title="" class="">It seems that the signal SIGINT is not received.</span></span><br><div><br data-mce-bogus="1"></div><div></div></div><div data-marker="__SIG_PRE__"><span class="tlid-translation translation" lang="en"><span title="" class="">I was try to debug with the use of scancel like this:<br data-mce-bogus="1"></span></span></div><div data-marker="__SIG_PRE__"><span class="tlid-translation translation" lang="en"><span title="" class=""><br data-mce-bogus="1"></span></span></div><div data-marker="__SIG_PRE__"><span class="tlid-translation translation" lang="en"><span title="" class="">scancel --signal=SIGINT IDJOB<br data-mce-bogus="1"></span></span></div><div data-marker="__SIG_PRE__"><span class="tlid-translation translation" lang="en"><span title="" class=""><br data-mce-bogus="1"></span></span></div><div data-marker="__SIG_PRE__"><span class="tlid-translation translation" lang="en"><span title="" class="">without success. In this way, <strong>only SIGKILL</strong> signals are received but a SIGKILL signal can't be trap.</span></span></div><div data-marker="__SIG_PRE__"><span class="tlid-translation translation" lang="en"><span title="" class=""><br data-mce-bogus="1"></span></span></div><div data-marker="__SIG_PRE__"><span class="tlid-translation translation" lang="en"><span title="" class="">In <a href="https://slurm.schedmd.com/scancel.html,">https://slurm.schedmd.com/scancel.html,</a> we can see in -b option, but seems to be the case even without -b option:<br></span></span></div><div data-marker="__SIG_PRE__"><em><span class="tlid-translation translation" lang="en"><span title="" class="">By default, signals other than SIGKILL are not sent to the batch step</span></span></em></div><div data-marker="__SIG_PRE__"><span class="tlid-translation translation" lang="en"><span title="" class=""><br data-mce-bogus="1"></span></span></div><div data-marker="__SIG_PRE__"><span class="tlid-translation translation" lang="en"><span title="" class="">How to change this default behavior?</span></span></div><div data-marker="__SIG_PRE__"><span class="tlid-translation translation" lang="en"><span title="" class=""><br data-mce-bogus="1"></span></span></div><div>Do you have the same behavior on your systems?<br><br>How would you get a SIGINT signal trapped in test.sh?</div><div data-marker="__SIG_PRE__"><span class="tlid-translation translation" lang="en"><span title="" class=""><br data-mce-bogus="1"></span></span></div><div data-marker="__SIG_PRE__"><span class="tlid-translation translation" lang="en"><span title="" class="">Best regards,<br data-mce-bogus="1"></span></span></div><div data-marker="__SIG_PRE__"><span class="tlid-translation translation" lang="en"><span title="" class=""><br data-mce-bogus="1"></span></span></div><div data-marker="__SIG_PRE__"><span class="tlid-translation translation" lang="en"><span title="" class="">Jean-Mathieu<br data-mce-bogus="1"></span></span></div><div data-marker="__SIG_PRE__"><span class="tlid-translation translation" lang="en"><span title="" class=""><br data-mce-bogus="1"></span></span></div><div data-marker="__SIG_PRE__"><span class="tlid-translation translation" lang="en"><span title="" class=""><br data-mce-bogus="1"></span></span></div></div></body></html>