No title Revision 663534393461 (Wed Aug 17 2011 at 03:05) - Diff Link to this snippet: https://friendpaste.com/R43WflJ8r75MupvXuS98v Embed: manni perldoc borland colorful default murphy trac fruity autumn bw emacs pastie friendly Show line numbers Wrap lines 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677diff --git a/bin/couchdb.tpl.in b/bin/couchdb.tpl.inindex 370bdb4..eab27b5 100644--- a/bin/couchdb.tpl.in+++ b/bin/couchdb.tpl.in@@ -15,7 +15,12 @@ BACKGROUND=false DEFAULT_CONFIG_DIR=%localconfdir%/default.d DEFAULT_CONFIG_FILE=%localconfdir%/%defaultini%-ERL_START_OPTIONS="-sasl errlog_type error +K true +A 4"+ERL_OS_MON_OPTIONS="-os_mon \+ start_memsup false \+ start_cpu_sup false \+ disk_space_check_interval 1 \+ disk_almost_full_threshold 1"+ERL_START_OPTIONS="$ERL_OS_MON_OPTIONS -sasl errlog_type error +K true +A 4" HEART_BEAT_TIMEOUT=11 HEART_COMMAND="%bindir%/%couchdb_command_name% -k" INTERACTIVE=falsediff --git a/src/couchdb/couch_app.erl b/src/couchdb/couch_app.erlindex 232953d..f109780 100644--- a/src/couchdb/couch_app.erl+++ b/src/couchdb/couch_app.erl@@ -20,7 +20,7 @@ start(_Type, DefaultIniFiles) -> IniFiles = get_ini_files(DefaultIniFiles),- case start_apps([crypto, public_key, sasl, inets, oauth, ssl, ibrowse, mochiweb]) of+ case start_apps([crypto, public_key, sasl, inets, oauth, ssl, ibrowse, mochiweb, os_mon]) of ok -> couch_server_sup:start_link(IniFiles); {error, Reason} ->diff --git a/src/couchdb/couch_compaction_daemon.erl b/src/couchdb/couch_compaction_daemon.erlindex ab85db8..6a0f140 100644--- a/src/couchdb/couch_compaction_daemon.erl+++ b/src/couchdb/couch_compaction_daemon.erl@@ -56,38 +56,15 @@ init(_) -> ?CONFIG_ETS = ets:new(?CONFIG_ETS, [named_table, set, protected]), ok = couch_config:register(fun ?MODULE:config_change/3), load_config(),- case start_os_mon() of- ok ->- Server = self(),- Loop = spawn_link(fun() -> compact_loop(Server) end),- {ok, #state{loop_pid = Loop}};- Error ->- {stop, Error}- end.+ Server = self(),+ Loop = spawn_link(fun() -> compact_loop(Server) end),+ {ok, #state{loop_pid = Loop}}. config_change("compactions", DbName, NewValue) -> ok = gen_server:cast(?MODULE, {config_update, DbName, NewValue}). -start_os_mon() ->- _ = application:load(os_mon),- ok = application:set_env(- os_mon, disk_space_check_interval, ?DISK_CHECK_PERIOD),- ok = application:set_env(os_mon, disk_almost_full_threshold, 1),- ok = application:set_env(os_mon, start_memsup, false),- ok = application:set_env(os_mon, start_cpu_sup, false),- _ = application:start(sasl),- case application:start(os_mon) of- ok ->- ok;- {error, {already_started, os_mon}} ->- ok;- Error ->- Error- end.-- handle_cast({config_update, DbName, deleted}, State) -> true = ets:delete(?CONFIG_ETS, ?l2b(DbName)), {noreply, State};