summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2013-02-22 21:24:20 +0100
committerJan Lehnardt <jan@apache.org>2013-02-23 19:01:18 +0100
commit410f4c980e6f3dbb02f0432280523e19210bb83e (patch)
treed994dfa598fa585bd12d1a96f64b3db04c99bd51
parente14a2e59637a083b1ceeaa31afca2c87ea6199f1 (diff)
downloadcouchdb-replace-init-restart-with-kill-dash-nine-booyah.tar.gz
init:restart() is evil, /_restart is evil, kill -TERM is awesomereplace-init-restart-with-kill-dash-nine-booyah
-rw-r--r--src/couchdb/couch_httpd_misc_handlers.erl2
-rw-r--r--src/couchdb/couch_server_sup.erl5
2 files changed, 2 insertions, 5 deletions
diff --git a/src/couchdb/couch_httpd_misc_handlers.erl b/src/couchdb/couch_httpd_misc_handlers.erl
index d1f947d18..cbb843444 100644
--- a/src/couchdb/couch_httpd_misc_handlers.erl
+++ b/src/couchdb/couch_httpd_misc_handlers.erl
@@ -98,7 +98,7 @@ handle_restart_req(#httpd{method='POST'}=Req) ->
couch_httpd:validate_ctype(Req, "application/json"),
ok = couch_httpd:verify_is_server_admin(Req),
Result = send_json(Req, 202, {[{ok, true}]}),
- couch_server_sup:restart_core_server(),
+ os:cmd("kill -TERM " ++ os:getpid()), % yolo
Result;
handle_restart_req(Req) ->
send_method_not_allowed(Req, "POST").
diff --git a/src/couchdb/couch_server_sup.erl b/src/couchdb/couch_server_sup.erl
index be3c3a3e4..0a894bd47 100644
--- a/src/couchdb/couch_server_sup.erl
+++ b/src/couchdb/couch_server_sup.erl
@@ -15,7 +15,7 @@
-export([start_link/1,stop/0, couch_config_start_link_wrapper/2,
- restart_core_server/0, config_change/2]).
+ config_change/2]).
-include("couch_db.hrl").
@@ -30,9 +30,6 @@ start_link(IniFiles) ->
{error, already_started}
end.
-restart_core_server() ->
- init:restart().
-
couch_config_start_link_wrapper(IniFiles, FirstConfigPid) ->
case is_process_alive(FirstConfigPid) of
true ->