Re: capturing system shutdown signals?

Grégory Vanuxem <[email protected]>
Newsgroups gmane.lisp.steel-bank.general
Message-ID <CAHnU2dbDuOGBoh8aynEb2jKZ9ZKPr2WFU98Aj+hDmPmBvKpWQQ@mail.gmail.com>
I think the signal-handler stuff in the UNIX package should help you.
Install one or more handler(s) I guess:

https://github.com/sbcl/sbcl/blob/master/src/code/signal.lisp

For Unix-like (POSIX)
signals, see:

https://sites.uclouvain.be/SystInfo/usr/include/asm-generic/signal.h.html


You will first need to handle the SIGTERM, 15 , but eventually 9, hard
kill. Eventually more since there are also some other terminaison
mechanisms,  but I think the SBCL debugger is invoked there, for example
floating-point exceptions (division by 0 for example). See man signal(s).

https://pubs.opengroup.org/onlinepubs/7908799/xsh/signal.h.html


- Greg






Le sam. 27 avr. 2024 à 00:31, Stas Boukarev <[email protected]> a écrit :

> My "man kill" doesn't contain the word "shutdown" and
> kill -L
> says
> kill: unknown signal: SIGL
>
> On Sat, Apr 27, 2024 at 1:15 AM Jeff Cunningham <[email protected]>
> wrote:
>
>> See "man kill" or "kill -L" for a list.
>>
>>
>>
>>
>> On Fri, 26 Apr 2024 23:36:18 +0300
>> Stas Boukarev <[email protected]> wrote:
>>
>> > What's a shutdown signal?
>> >
>> > On Fri, Apr 26, 2024 at 8:14 PM Jeff Cunningham <
>> [email protected]>
>> > wrote:
>> >
>> > > Is there a way to capture a general shutdown signal in a running
>> > > sbcl-compiled program (Hunchentoot
>> > > server) so it can gracefully do some house-keeping first? This is
>> running
>> > > on a Linux platform. I
>> > > had a binary data file destroyed the other day from improper closure
>> while
>> > > writing.
>> > >
>> > > Best regards,
>> > >
>> > > -- Jeff
>> > >
>> > >
>> > >
>> > >
>> > >
>> > >
>> > >
>> > >
>> > > _______________________________________________
>> > > Sbcl-help mailing list
>> > > [email protected]
>> > > https://lists.sourceforge.net/lists/listinfo/sbcl-help
>> > >
>>
>> _______________________________________________
> Sbcl-help mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sbcl-help
>

_______________________________________________
Sbcl-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sbcl-help
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.