2003-02-01 21:21:28 +01:00
|
|
|
%%%----------------------------------------------------------------------
|
|
|
|
%%% File : ejabberd_sup.erl
|
2007-12-24 12:41:41 +01:00
|
|
|
%%% Author : Alexey Shchepin <alexey@process-one.net>
|
|
|
|
%%% Purpose : Erlang/OTP supervisor
|
|
|
|
%%% Created : 31 Jan 2003 by Alexey Shchepin <alexey@process-one.net>
|
|
|
|
%%%
|
|
|
|
%%%
|
2010-01-12 17:15:16 +01:00
|
|
|
%%% ejabberd, Copyright (C) 2002-2010 ProcessOne
|
2007-12-24 12:41:41 +01:00
|
|
|
%%%
|
|
|
|
%%% This program is free software; you can redistribute it and/or
|
|
|
|
%%% modify it under the terms of the GNU General Public License as
|
|
|
|
%%% published by the Free Software Foundation; either version 2 of the
|
|
|
|
%%% License, or (at your option) any later version.
|
|
|
|
%%%
|
|
|
|
%%% This program is distributed in the hope that it will be useful,
|
|
|
|
%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
%%% General Public License for more details.
|
2009-01-12 15:44:42 +01:00
|
|
|
%%%
|
2007-12-24 12:41:41 +01:00
|
|
|
%%% You should have received a copy of the GNU General Public License
|
|
|
|
%%% along with this program; if not, write to the Free Software
|
|
|
|
%%% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
|
|
|
%%% 02111-1307 USA
|
|
|
|
%%%
|
2003-02-01 21:21:28 +01:00
|
|
|
%%%----------------------------------------------------------------------
|
|
|
|
|
|
|
|
-module(ejabberd_sup).
|
2007-12-24 12:41:41 +01:00
|
|
|
-author('alexey@process-one.net').
|
2003-02-01 21:21:28 +01:00
|
|
|
|
|
|
|
-behaviour(supervisor).
|
|
|
|
|
|
|
|
-export([start_link/0, init/1]).
|
|
|
|
|
|
|
|
start_link() ->
|
|
|
|
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
|
|
|
|
|
|
|
|
init([]) ->
|
2004-08-08 21:07:55 +02:00
|
|
|
Hooks =
|
|
|
|
{ejabberd_hooks,
|
|
|
|
{ejabberd_hooks, start_link, []},
|
|
|
|
permanent,
|
|
|
|
brutal_kill,
|
|
|
|
worker,
|
|
|
|
[ejabberd_hooks]},
|
2010-07-22 18:41:53 +02:00
|
|
|
GlobalRouter =
|
|
|
|
{ejabberd_global_router,
|
|
|
|
{ejabberd_global_router, start_link, []},
|
2007-04-12 07:31:53 +02:00
|
|
|
permanent,
|
|
|
|
brutal_kill,
|
|
|
|
worker,
|
2010-07-22 18:41:53 +02:00
|
|
|
[ejabberd_global_router]},
|
2004-08-08 21:07:55 +02:00
|
|
|
Router =
|
|
|
|
{ejabberd_router,
|
|
|
|
{ejabberd_router, start_link, []},
|
|
|
|
permanent,
|
|
|
|
brutal_kill,
|
|
|
|
worker,
|
|
|
|
[ejabberd_router]},
|
2010-05-19 23:49:57 +02:00
|
|
|
Router_multicast =
|
|
|
|
{ejabberd_router_multicast,
|
|
|
|
{ejabberd_router_multicast, start_link, []},
|
|
|
|
permanent,
|
|
|
|
brutal_kill,
|
|
|
|
worker,
|
|
|
|
[ejabberd_router_multicast]},
|
2004-08-08 21:07:55 +02:00
|
|
|
SM =
|
|
|
|
{ejabberd_sm,
|
|
|
|
{ejabberd_sm, start_link, []},
|
|
|
|
permanent,
|
|
|
|
brutal_kill,
|
|
|
|
worker,
|
|
|
|
[ejabberd_sm]},
|
|
|
|
S2S =
|
|
|
|
{ejabberd_s2s,
|
|
|
|
{ejabberd_s2s, start_link, []},
|
|
|
|
permanent,
|
|
|
|
brutal_kill,
|
|
|
|
worker,
|
|
|
|
[ejabberd_s2s]},
|
|
|
|
Local =
|
|
|
|
{ejabberd_local,
|
|
|
|
{ejabberd_local, start_link, []},
|
|
|
|
permanent,
|
|
|
|
brutal_kill,
|
|
|
|
worker,
|
|
|
|
[ejabberd_local]},
|
2009-03-13 17:01:46 +01:00
|
|
|
Captcha =
|
|
|
|
{ejabberd_captcha,
|
|
|
|
{ejabberd_captcha, start_link, []},
|
|
|
|
permanent,
|
|
|
|
brutal_kill,
|
|
|
|
worker,
|
|
|
|
[ejabberd_captcha]},
|
2004-08-08 21:07:55 +02:00
|
|
|
Listener =
|
|
|
|
{ejabberd_listener,
|
|
|
|
{ejabberd_listener, start_link, []},
|
|
|
|
permanent,
|
|
|
|
infinity,
|
|
|
|
supervisor,
|
|
|
|
[ejabberd_listener]},
|
2006-01-29 05:38:31 +01:00
|
|
|
ReceiverSupervisor =
|
|
|
|
{ejabberd_receiver_sup,
|
|
|
|
{ejabberd_tmp_sup, start_link,
|
|
|
|
[ejabberd_receiver_sup, ejabberd_receiver]},
|
|
|
|
permanent,
|
|
|
|
infinity,
|
|
|
|
supervisor,
|
|
|
|
[ejabberd_tmp_sup]},
|
2008-10-24 19:26:11 +02:00
|
|
|
C2SSupervisor =
|
|
|
|
{ejabberd_c2s_sup,
|
|
|
|
{ejabberd_tmp_sup, start_link, [ejabberd_c2s_sup, ejabberd_c2s]},
|
|
|
|
permanent,
|
|
|
|
infinity,
|
|
|
|
supervisor,
|
|
|
|
[ejabberd_tmp_sup]},
|
|
|
|
S2SInSupervisor =
|
|
|
|
{ejabberd_s2s_in_sup,
|
|
|
|
{ejabberd_tmp_sup, start_link,
|
|
|
|
[ejabberd_s2s_in_sup, ejabberd_s2s_in]},
|
|
|
|
permanent,
|
|
|
|
infinity,
|
|
|
|
supervisor,
|
|
|
|
[ejabberd_tmp_sup]},
|
2003-07-20 22:35:35 +02:00
|
|
|
S2SOutSupervisor =
|
|
|
|
{ejabberd_s2s_out_sup,
|
|
|
|
{ejabberd_tmp_sup, start_link,
|
|
|
|
[ejabberd_s2s_out_sup, ejabberd_s2s_out]},
|
|
|
|
permanent,
|
|
|
|
infinity,
|
|
|
|
supervisor,
|
|
|
|
[ejabberd_tmp_sup]},
|
|
|
|
ServiceSupervisor =
|
|
|
|
{ejabberd_service_sup,
|
|
|
|
{ejabberd_tmp_sup, start_link,
|
|
|
|
[ejabberd_service_sup, ejabberd_service]},
|
|
|
|
permanent,
|
|
|
|
infinity,
|
|
|
|
supervisor,
|
|
|
|
[ejabberd_tmp_sup]},
|
2010-07-22 18:41:53 +02:00
|
|
|
Hosts =
|
|
|
|
{ejabberd_hosts,
|
|
|
|
{ejabberd_hosts, start_link, []},
|
|
|
|
permanent,
|
|
|
|
brutal_kill,
|
|
|
|
worker,
|
|
|
|
[ejabberd_hosts]},
|
2008-10-24 19:26:11 +02:00
|
|
|
HTTPSupervisor =
|
|
|
|
{ejabberd_http_sup,
|
|
|
|
{ejabberd_tmp_sup, start_link,
|
|
|
|
[ejabberd_http_sup, ejabberd_http]},
|
|
|
|
permanent,
|
|
|
|
infinity,
|
|
|
|
supervisor,
|
|
|
|
[ejabberd_tmp_sup]},
|
2004-03-06 22:13:16 +01:00
|
|
|
HTTPPollSupervisor =
|
|
|
|
{ejabberd_http_poll_sup,
|
|
|
|
{ejabberd_tmp_sup, start_link,
|
|
|
|
[ejabberd_http_poll_sup, ejabberd_http_poll]},
|
|
|
|
permanent,
|
|
|
|
infinity,
|
|
|
|
supervisor,
|
|
|
|
[ejabberd_tmp_sup]},
|
2006-11-07 03:08:51 +01:00
|
|
|
FrontendSocketSupervisor =
|
|
|
|
{ejabberd_frontend_socket_sup,
|
|
|
|
{ejabberd_tmp_sup, start_link,
|
|
|
|
[ejabberd_frontend_socket_sup, ejabberd_frontend_socket]},
|
|
|
|
permanent,
|
|
|
|
infinity,
|
|
|
|
supervisor,
|
|
|
|
[ejabberd_tmp_sup]},
|
2003-07-20 22:35:35 +02:00
|
|
|
IQSupervisor =
|
|
|
|
{ejabberd_iq_sup,
|
|
|
|
{ejabberd_tmp_sup, start_link,
|
|
|
|
[ejabberd_iq_sup, gen_iq_handler]},
|
|
|
|
permanent,
|
|
|
|
infinity,
|
|
|
|
supervisor,
|
|
|
|
[ejabberd_tmp_sup]},
|
2009-08-09 12:44:16 +02:00
|
|
|
STUNSupervisor =
|
|
|
|
{ejabberd_stun_sup,
|
|
|
|
{ejabberd_tmp_sup, start_link,
|
|
|
|
[ejabberd_stun_sup, ejabberd_stun]},
|
|
|
|
permanent,
|
|
|
|
infinity,
|
|
|
|
supervisor,
|
|
|
|
[ejabberd_tmp_sup]},
|
2010-06-02 16:01:36 +02:00
|
|
|
Cluster =
|
|
|
|
{ejabberd_cluster,
|
|
|
|
{ejabberd_cluster, start_link, []},
|
|
|
|
permanent,
|
|
|
|
brutal_kill,
|
|
|
|
worker,
|
|
|
|
[ejabberd_cluster]},
|
2010-08-30 06:02:47 +02:00
|
|
|
CacheTabSupervisor =
|
|
|
|
{cache_tab_sup,
|
|
|
|
{cache_tab_sup, start_link, []},
|
|
|
|
permanent,
|
|
|
|
infinity,
|
|
|
|
supervisor,
|
|
|
|
[cache_tab_sup]},
|
2003-07-20 22:35:35 +02:00
|
|
|
{ok, {{one_for_one, 10, 1},
|
2004-08-08 21:07:55 +02:00
|
|
|
[Hooks,
|
2010-07-22 18:41:53 +02:00
|
|
|
GlobalRouter,
|
2010-06-02 16:01:36 +02:00
|
|
|
Cluster,
|
2004-08-08 21:07:55 +02:00
|
|
|
Router,
|
2010-05-19 23:49:57 +02:00
|
|
|
Router_multicast,
|
2004-08-08 21:07:55 +02:00
|
|
|
SM,
|
|
|
|
S2S,
|
|
|
|
Local,
|
2009-03-13 17:01:46 +01:00
|
|
|
Captcha,
|
2006-01-29 05:38:31 +01:00
|
|
|
ReceiverSupervisor,
|
2008-10-24 19:26:11 +02:00
|
|
|
C2SSupervisor,
|
|
|
|
S2SInSupervisor,
|
2003-07-20 22:35:35 +02:00
|
|
|
S2SOutSupervisor,
|
|
|
|
ServiceSupervisor,
|
2010-07-22 18:41:53 +02:00
|
|
|
Hosts,
|
2008-10-24 19:26:11 +02:00
|
|
|
HTTPSupervisor,
|
2004-03-06 22:13:16 +01:00
|
|
|
HTTPPollSupervisor,
|
2003-07-20 22:35:35 +02:00
|
|
|
IQSupervisor,
|
2009-08-09 12:44:16 +02:00
|
|
|
STUNSupervisor,
|
2006-11-07 03:08:51 +01:00
|
|
|
FrontendSocketSupervisor,
|
2010-08-30 06:02:47 +02:00
|
|
|
CacheTabSupervisor,
|
2003-07-20 22:35:35 +02:00
|
|
|
Listener]}}.
|
2003-02-01 21:21:28 +01:00
|
|
|
|
|
|
|
|