lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Lua signal handlers is not something I would ever expect to work in a reliable manner. Lua is not async signal safe.

That sounds like a terrible idea by luaposix

On 26 Dec 2012 15:59, "Bernd Eggink" <monoped@sudrala.de> wrote:
Hi,

I wonder if signal handling (as in luaposix) is supposed to work in any situation. Or are there limitations, preconditions etc.(on Linux)?

I'm asking because I have a program where signal() simply doesn't work. After putting

        local P = require "posix"
        P.signal(P.SIGUSR1, function() print("signal") end)

at the beginning of the program, I expect the command "kill -s USR1 $pid" to print "signal", but instead the program exits immediately. This even happens when the signal handling function is completely empty.

The program in question is pretty complex. However, in simple test programs signal() works as expected.

Any ideas what could prevent signal() from working correctly?

Greetings,
Bernd