%% @author Northscale <info@northscale.com>
%% @copyright 2009 NorthScale, Inc.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%%      http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by applicable law or agreed to in writing, software
%% distributed under the License is distributed on an "AS IS" BASIS,
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
%%
-module(ns_bootstrap).

-export([start/0, override_resolver/0]).

start() ->
    try
        ok = application:start(sasl),
        application:start(os_mon),
        ok = application:start(ns_server)
    catch T:E ->
            timer:sleep(500),
            erlang:T(E)
    end.

override_resolver() ->
    inet_db:set_lookup([file, dns]),
    start().

%% @author Northscale <info@northscale.com>
%% @copyright 2009 NorthScale, Inc.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%%      http://www.apache.org/licenses/LICENSE-2.0
%%
%% Unless required by applicable law or agreed to in writing, software
%% distributed under the License is distributed on an "AS IS" BASIS,
%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
%% See the License for the specific language governing permissions and
%% limitations under the License.
%%
-module(ns_bootstrap).

-export([start/0, override_resolver/0]).

start() ->
    try
        %% Check disk space every minute instead of every 30
        application:set_env(os_mon, disk_space_check_interval, 1),
        ok = application:start(sasl),
        application:start(os_mon),
        ok = application:start(ns_server)
    catch T:E ->
            timer:sleep(500),
            erlang:T(E)
    end.

override_resolver() ->
    inet_db:set_lookup([file, dns]),
    start().

Set disksup check interval to 1 minute.
Set disksup check interval to 1 minute.

This made the "line of death," not to mention free space, only update
once every 30 minutes, since that's the default check interval.

Change-Id: I15cd757b2cf5743bb830481ff6c8308b96769338
Reviewed-on: http://review.membase.org/4120
Tested-by: Steve Yen <ef850f73f7832052d3c6d9b5ddd3a1716d9a57f1@gmail.com>
Reviewed-by: Steve Yen <ef850f73f7832052d3c6d9b5ddd3a1716d9a57f1@gmail.com>
