Erlang Linux signal handling

前端 未结 2 700
你的背包
你的背包 2021-02-05 12:12

Is it possible to trap Linux signals (e.g. SIGUSR1) through an handler in Erlang? (without having to resort to a driver crafted in C)

2条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-05 12:29

    (NOT A REAL ANSWER)

    In 2001 someone asked:

    Does anyone have any examples of unix signal handling in erlang. I would like to make a loadbalancer that I have written respond to sighup.

    At that time the answer was:

    There is no provision for handling signals in Erlang "itself", i.e. you will need to use a driver - or a port program of course, might actually be a better idea. Also for the driver case, the emulator has its own handler for a number of signals, and interfering with that will probably have "interesting" results - but SIGHUP should be OK I believe.

    SOURCE: http://www.erlang.org/pipermail/erlang-questions/2001-October/003752.html

    As far as I know, nothing changed since then. But this is extremely interesting. If anyone has any news about this, please let us know :)

提交回复
热议问题