When hal asks the running application to stop, it does so by asking supervisord to ctl stop run. The supervisord configuration doesn't have a stopsignal configuration, so supervisord proceeds to directly sending SIGKILL. It's a good practice that applications react to SIGTERM and perform graceful shutdown. This commit therefore configures supervisord to first send SIGTERM and only if the application is still running after 5 seconds, proceed with SIGKILL.
I just realized I didn't really test this with an application that doesn't react to SIGTERM :-) Not sure if, in such situation, supervisord ctl stop run will wait until SIGKILL is delivered or not.
When
hal
asks the running application to stop, it does so by askingsupervisord
toctl stop run
. Thesupervisord
configuration doesn't have astopsignal
configuration, sosupervisord
proceeds to directly sendingSIGKILL
. It's a good practice that applications react toSIGTERM
and perform graceful shutdown. This commit therefore configuressupervisord
to first sendSIGTERM
and only if the application is still running after 5 seconds, proceed withSIGKILL
.