~ubuntu-branches/debian/squeeze/erlang/squeeze

« back to all changes in this revision

Viewing changes to lib/eva/src/eva_log_sup.erl

  • Committer: Bazaar Package Importer
  • Author(s): Erlang Packagers, Sergei Golovan
  • Date: 2006-12-03 17:07:44 UTC
  • mfrom: (2.1.11 feisty)
  • Revision ID: james.westby@ubuntu.com-20061203170744-rghjwupacqlzs6kv
Tags: 1:11.b.2-4
[ Sergei Golovan ]
Fixed erlang-base and erlang-base-hipe prerm scripts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
%% ``The contents of this file are subject to the Erlang Public License,
2
 
%% Version 1.1, (the "License"); you may not use this file except in
3
 
%% compliance with the License. You should have received a copy of the
4
 
%% Erlang Public License along with this software. If not, it can be
5
 
%% retrieved via the world wide web at http://www.erlang.org/.
6
 
%% 
7
 
%% Software distributed under the License is distributed on an "AS IS"
8
 
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
9
 
%% the License for the specific language governing rights and limitations
10
 
%% under the License.
11
 
%% 
12
 
%% The Initial Developer of the Original Code is Ericsson Utvecklings AB.
13
 
%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
14
 
%% AB. All Rights Reserved.''
15
 
%% 
16
 
%%     $Id$
17
 
%%
18
 
-module(eva_log_sup).
19
 
 
20
 
-behaviour(supervisor).
21
 
 
22
 
-define(LogServer, {log_server,
23
 
                    {log_server, start_link, []},
24
 
                    permanent, 2000, worker, [log_server]}).
25
 
 
26
 
-define(LogSnmp, {log_snmp,
27
 
                  {log_snmp, start_link, []},
28
 
                  permanent, 2000, worker, [log_snmp]}).
29
 
 
30
 
%% External exports
31
 
-export([start_link/1, start_link/3]).
32
 
 
33
 
%% Internal exports
34
 
-export([init/1]).
35
 
 
36
 
%%-----------------------------------------------------------------
37
 
%% Convinent supervisor to use for LOG, with or without snmp
38
 
%% implementation.
39
 
%%-----------------------------------------------------------------
40
 
start_link(DefaultLog) ->
41
 
    supervisor:start_link({local, eva_log_sup}, ?MODULE, DefaultLog).
42
 
start_link(DefaultLog, LogDir, MaxDirSize) ->
43
 
    supervisor:start_link({local, eva_log_sup}, ?MODULE,
44
 
                          {DefaultLog, LogDir, MaxDirSize}).
45
 
 
46
 
init({DefaultLog, LogDir, MaxDirSize}) ->
47
 
    SupFlags = {rest_for_one, 4, 3600},
48
 
    EvaLogH = {eva_log_h_sup,
49
 
               {eva_log, start_link, [DefaultLog]},
50
 
               permanent, 2000, worker, [eva_log]},
51
 
    EvaLogSnmp = {eva_log_snmp,
52
 
                  {eva_log_snmp, start_link, [LogDir, MaxDirSize]},
53
 
                  permanent, 2000, worker, [eva_log_snmp]},
54
 
    {ok, {SupFlags, [?LogServer, EvaLogH, ?LogSnmp, EvaLogSnmp]}};
55
 
 
56
 
init(DefaultLog) ->
57
 
    SupFlags = {rest_for_one, 4, 3600},
58
 
    EvaLogH = {eva_log_h_sup,
59
 
               {eva_log, start_link, [DefaultLog]},
60
 
               permanent, 2000, worker, [eva_log]},
61
 
    {ok, {SupFlags, [?LogServer, EvaLogH]}}.