SIGHUP: failed for SignalException with script/runner
-
06-03-2021 - |
Pregunta
Hi I am trying to run a script/runner process which failed because of SignalException: SIGHUP:
The process nearly takes 4-5hrs. Can someone please let me know what exactly is happening and what would be a work around.
Thanks
Solución
The shell the process was started from is dying. You can either disown the process from the calling shell or call it with nohup
, which will cause the process to ignore SIGHUPs.
Something like nohup script/runner "YourCodeHere.run" &
would make the script/runner task impervious to SIGHUPs.
Edit: Say you ssh into a server. You'll spawn a new shell (running /bin/bash would work similarly). If you drop connection, the shell you started with ssh also dies. When it does, it sends SIGHUP to all of the attached processes. SIGHUP is a UNIX signal. There are a few of them. Another you're probably (perhaps unknowingly) familiar with is SIGINT, which is what is sent to the process when you hit ctrl-c.