[Openmcl-devel] Handling SIGTERM in applications
max at mr.gy
Wed Oct 26 01:59:50 UTC 2016
On Wed, 26 Oct 2016 01:09:28 +0000, Max Rottenkolber wrote:
> D'oh. I meant SIGINT. SIGTERM works just fine. To reprodcuce:
> :toplevel-function (lambda () (loop do (sleep 1)))
> :error-handler :quit
> :purify t
> :prepend-kernel t)
> $ ./sigint-test # send it SIGINT
> C-c C-c> Break: interrupt signal
>> While executing: CCL::%NANOSLEEP, in process toplevel(2).
>> Type :GO to continue, :POP to abort, :R for a list of available restarts.
>> If continued: Return from BREAK.
>> Type :? for other options.
> 1 >
> (Note that there is no actual break loop, it just prints the above and gets
> stuck, ignoring input, or a subsequent SIGINT.)
I was able to work around this by setting two internal special variables:
(setf ccl::*invoke-debugger-hook-on-interrupt* t)
(lambda (condition hook)
(declare (ignore hook))
(ccl::interrupt-signal-condition (quit 130)))))
More information about the Openmcl-devel