summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_server_sup.erl
diff options
context:
space:
mode:
authorDamien F. Katz <damien@apache.org>2008-11-20 04:42:43 +0000
committerDamien F. Katz <damien@apache.org>2008-11-20 04:42:43 +0000
commit2c260766864a56e10aa45c3b1782f640b21a0bac (patch)
treeba41373450b909079755103172fb14a7ed7944c6 /src/couchdb/couch_server_sup.erl
parent8ec0f5d5407ccd9a7cee0fc579ad08d8f4be5bd7 (diff)
Nearly completed security/validation work. Still needs replication testing.
git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@719160 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/couchdb/couch_server_sup.erl')
-rw-r--r--src/couchdb/couch_server_sup.erl12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/couchdb/couch_server_sup.erl b/src/couchdb/couch_server_sup.erl
index b75747d7..9c74a1a3 100644
--- a/src/couchdb/couch_server_sup.erl
+++ b/src/couchdb/couch_server_sup.erl
@@ -14,7 +14,9 @@
-behaviour(supervisor).
--export([start_link/1,stop/0,couch_config_start_link_wrapper/2,start_primary_services/0,start_secondary_services/0]).
+-export([start_link/1,stop/0, couch_config_start_link_wrapper/2,
+ start_primary_services/0,start_secondary_services/0,
+ restart_core_server/0]).
-include("couch_db.hrl").
@@ -29,6 +31,10 @@ start_link(IniFiles) ->
{error, already_started}
end.
+restart_core_server() ->
+ supervisor:terminate_child(couch_primary_services, couch_server),
+ supervisor:restart_child(couch_primary_services, couch_server).
+
couch_config_start_link_wrapper(IniFiles, FirstConfigPid) ->
case is_process_alive(FirstConfigPid) of
true ->
@@ -119,7 +125,7 @@ start_server(IniFiles) ->
{ok, Pid}.
start_primary_services() ->
- supervisor:start_link(couch_server_sup,
+ supervisor:start_link({local, couch_primary_services}, couch_server_sup,
{{one_for_one, 10, 3600},
[{couch_log,
{couch_log, start_link, []},
@@ -156,7 +162,7 @@ start_secondary_services() ->
|| {Name, SpecStr}
<- couch_config:get("daemons"), SpecStr /= ""],
- supervisor:start_link(couch_server_sup,
+ supervisor:start_link({local, couch_secondary_services}, couch_server_sup,
{{one_for_one, 10, 3600}, DaemonChildSpecs}).
stop() ->