| a | b | |
|---|
| 0 | + | diff --git a/bin/couchdb.tpl.in b/bin/couchdb.tpl.in |
|---|
| 0 | + | index 370bdb4..eab27b5 100644 |
|---|
| 0 | + | --- a/bin/couchdb.tpl.in |
|---|
| 0 | + | +++ b/bin/couchdb.tpl.in |
|---|
| 0 | + | @@ -15,7 +15,12 @@ |
|---|
| 0 | + | BACKGROUND=false |
|---|
| 0 | + | DEFAULT_CONFIG_DIR=%localconfdir%/default.d |
|---|
| 0 | + | DEFAULT_CONFIG_FILE=%localconfdir%/%defaultini% |
|---|
| 0 | + | -ERL_START_OPTIONS="-sasl errlog_type error +K true +A 4" |
|---|
| 0 | + | +ERL_OS_MON_OPTIONS="-os_mon \ |
|---|
| 0 | + | + start_memsup false \ |
|---|
| 0 | + | + start_cpu_sup false \ |
|---|
| 0 | + | + disk_space_check_interval 1 \ |
|---|
| 0 | + | + disk_almost_full_threshold 1" |
|---|
| 0 | + | +ERL_START_OPTIONS="$ERL_OS_MON_OPTIONS -sasl errlog_type error +K true +A 4" |
|---|
| 0 | + | HEART_BEAT_TIMEOUT=11 |
|---|
| 0 | + | HEART_COMMAND="%bindir%/%couchdb_command_name% -k" |
|---|
| 0 | + | INTERACTIVE=false |
|---|
| 0 | + | diff --git a/src/couchdb/couch_app.erl b/src/couchdb/couch_app.erl |
|---|
| 0 | + | index 232953d..f109780 100644 |
|---|
| 0 | + | --- a/src/couchdb/couch_app.erl |
|---|
| 0 | + | +++ b/src/couchdb/couch_app.erl |
|---|
| 0 | + | @@ -20,7 +20,7 @@ |
|---|
| 0 | + | |
|---|
| 0 | + | start(_Type, DefaultIniFiles) -> |
|---|
| 0 | + | IniFiles = get_ini_files(DefaultIniFiles), |
|---|
| 0 | + | - case start_apps([crypto, public_key, sasl, inets, oauth, ssl, ibrowse, mochiweb]) of |
|---|
| 0 | + | + case start_apps([crypto, public_key, sasl, inets, oauth, ssl, ibrowse, mochiweb, os_mon]) of |
|---|
| 0 | + | ok -> |
|---|
| 0 | + | couch_server_sup:start_link(IniFiles); |
|---|
| 0 | + | {error, Reason} -> |
|---|
| 0 | + | diff --git a/src/couchdb/couch_compaction_daemon.erl b/src/couchdb/couch_compaction_daemon.erl |
|---|
| 0 | + | index ab85db8..6a0f140 100644 |
|---|
| 0 | + | --- a/src/couchdb/couch_compaction_daemon.erl |
|---|
| 0 | + | +++ b/src/couchdb/couch_compaction_daemon.erl |
|---|
| 0 | + | @@ -56,38 +56,15 @@ init(_) -> |
|---|
| 0 | + | ?CONFIG_ETS = ets:new(?CONFIG_ETS, [named_table, set, protected]), |
|---|
| 0 | + | ok = couch_config:register(fun ?MODULE:config_change/3), |
|---|
| 0 | + | load_config(), |
|---|
| 0 | + | - case start_os_mon() of |
|---|
| 0 | + | - ok -> |
|---|
| 0 | + | - Server = self(), |
|---|
| 0 | + | - Loop = spawn_link(fun() -> compact_loop(Server) end), |
|---|
| 0 | + | - {ok, #state{loop_pid = Loop}}; |
|---|
| 0 | + | - Error -> |
|---|
| 0 | + | - {stop, Error} |
|---|
| 0 | + | - end. |
|---|
| 0 | + | + Server = self(), |
|---|
| 0 | + | + Loop = spawn_link(fun() -> compact_loop(Server) end), |
|---|
| 0 | + | + {ok, #state{loop_pid = Loop}}. |
|---|
| 0 | + | |
|---|
| 0 | + | |
|---|
| 0 | + | config_change("compactions", DbName, NewValue) -> |
|---|
| 0 | + | ok = gen_server:cast(?MODULE, {config_update, DbName, NewValue}). |
|---|
| 0 | + | |
|---|
| 0 | + | |
|---|
| 0 | + | -start_os_mon() -> |
|---|
| 0 | + | - _ = application:load(os_mon), |
|---|
| 0 | + | - ok = application:set_env( |
|---|
| 0 | + | - os_mon, disk_space_check_interval, ?DISK_CHECK_PERIOD), |
|---|
| 0 | + | - ok = application:set_env(os_mon, disk_almost_full_threshold, 1), |
|---|
| 0 | + | - ok = application:set_env(os_mon, start_memsup, false), |
|---|
| 0 | + | - ok = application:set_env(os_mon, start_cpu_sup, false), |
|---|
| 0 | + | - _ = application:start(sasl), |
|---|
| 0 | + | - case application:start(os_mon) of |
|---|
| 0 | + | - ok -> |
|---|
| 0 | + | - ok; |
|---|
| 0 | + | - {error, {already_started, os_mon}} -> |
|---|
| 0 | + | - ok; |
|---|
| 0 | + | - Error -> |
|---|
| 0 | + | - Error |
|---|
| 0 | + | - end. |
|---|
| 0 | + | - |
|---|
| 0 | + | - |
|---|
| 0 | + | handle_cast({config_update, DbName, deleted}, State) -> |
|---|
| 0 | + | true = ets:delete(?CONFIG_ETS, ?l2b(DbName)), |
|---|
| 0 | + | {noreply, State}; |
|---|
| ... | |
|---|