diff options
author | Björn-Egil Dahlberg <[email protected]> | 2017-02-03 15:22:06 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2017-02-03 15:22:06 +0100 |
commit | e53e74c5349061857d8eeb9c564768e54446012a (patch) | |
tree | 1c7ebcd38ff44e9ca0d8ba558e334791858b5096 /lib/kernel/src/kernel.erl | |
parent | 08726ff1c6a0bfb9989034920184438aed9db8bd (diff) | |
parent | 1409b6ae110f60c410e83d1923dd59ae3659a887 (diff) | |
download | otp-e53e74c5349061857d8eeb9c564768e54446012a.tar.gz otp-e53e74c5349061857d8eeb9c564768e54446012a.tar.bz2 otp-e53e74c5349061857d8eeb9c564768e54446012a.zip |
Merge branch 'egil/20/erts/signal-service/OTP-14186'
* egil/20/erts/signal-service/OTP-14186:
kernel: Document signal server
erts: Use os module instead of erts_internal for set_signal/2
erts: Do not handle SIGILL
erts: Fix thread suspend in crashdump
erts: Do not enable SIGINT
erts: Use generic signal handler
erts: Add OS signal tests
erts: Handle SIGUSR1 via signal service instead
erts: Handle SIGTERM via signal service instead
kernel: Add gen_event signal server and default handler
erts: Add SIGHUP signal handler
erts: Remove whitespace errors
Conflicts:
erts/emulator/beam/bif.tab
Diffstat (limited to 'lib/kernel/src/kernel.erl')
-rw-r--r-- | lib/kernel/src/kernel.erl | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/kernel/src/kernel.erl b/lib/kernel/src/kernel.erl index 3d0ef81318..59eca242b1 100644 --- a/lib/kernel/src/kernel.erl +++ b/lib/kernel/src/kernel.erl @@ -32,6 +32,14 @@ start(_, []) -> case supervisor:start_link({local, kernel_sup}, kernel, []) of {ok, Pid} -> + %% add signal handler + case whereis(erl_signal_server) of + %% in case of minimal mode + undefined -> ok; + _ -> + ok = gen_event:add_handler(erl_signal_server, erl_signal_handler, []) + end, + %% add error handler Type = get_error_logger_type(), case error_logger:swap_handler(Type) of ok -> {ok, Pid, []}; @@ -131,6 +139,9 @@ init([]) -> permanent, 2000, worker, [inet_db]}, NetSup = {net_sup, {erl_distribution, start_link, []}, permanent, infinity, supervisor,[erl_distribution]}, + SigSrv = #{id => erl_signal_server, + start => {gen_event, start_link, [{local, erl_signal_server}]}, + type => worker, restart => permanent, shutdown => 2000, modules => dynamic}, DistAC = start_dist_ac(), Timer = start_timer(), @@ -141,7 +152,7 @@ init([]) -> permanent, infinity, supervisor, [?MODULE]}, {ok, {SupFlags, [Code, Rpc, Global, InetDb | DistAC] ++ - [NetSup, Glo_grp, File, + [NetSup, Glo_grp, File, SigSrv, StdError, User, Config, SafeSupervisor] ++ Timer}} end; init(safe) -> |