| Summary: | sending signals to batch script works only by chance | ||
|---|---|---|---|
| Product: | Slurm | Reporter: | Tim Ehlers <tehlers> |
| Component: | User Commands | Assignee: | Jason Booth <jbooth> |
| Status: | RESOLVED INFOGIVEN | QA Contact: | |
| Severity: | 4 - Minor Issue | ||
| Priority: | --- | CC: | bart, mboden |
| Version: | 18.08.6 | ||
| Hardware: | Linux | ||
| OS: | Linux | ||
| Site: | GWDG | Alineos Sites: | --- |
| Atos/Eviden Sites: | --- | Confidential Site: | --- |
| Coreweave sites: | --- | Cray Sites: | --- |
| DS9 clusters: | --- | HPCnow Sites: | --- |
| HPE Sites: | --- | IBM Sites: | --- |
| NOAA SIte: | --- | OCF Sites: | --- |
| Recursion Pharma Sites: | --- | SFW Sites: | --- |
| SNIC sites: | --- | Linux Distro: | --- |
| Machine Name: | CLE Version: | ||
| Version Fixed: | Target Release: | --- | |
| DevPrio: | --- | Emory-Cloud Sites: | --- |
|
Description
Tim Ehlers
2019-05-09 05:21:20 MDT
Hi Tim, This question has been asked by other sites in the past. This is expected behavior due to how bash waits for the process to return before processing signals. https://groups.google.com/forum/#!searchin/slurm-users/wait%7Csort:date/slurm-users/MWo-TfqgNww/0YCZAcC1BAAJ sleep 1000 & # <----- Your program goes here. It's important to run on the background otherwise bash will not process the signal until this command finishes wait # <---- wait until all the background processes are finished. If a signal is received this will stop, process the signal and finish the script. More information can be found here: http://mywiki.wooledge.org/SignalTrap#When_is_the and here: https://stackoverflow.com/questions/27694818/interrupt-sleep-in-bash-with-a-signal-trap Hey Jason, thanks for the info, it works! Best, Marcus |