From d5f3e25e0cafc5cb8d2420406c9af8de56c552b0 Mon Sep 17 00:00:00 2001 From: Benoit Chesneau Date: Fri, 2 Jul 2010 18:59:29 +0000 Subject: close #COUCHDB-393. save the uri http://IP:PORT/ in %localstatelibdir%/couch.uri when couchdb start. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@960087 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_server_sup.erl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/couchdb/couch_server_sup.erl') diff --git a/src/couchdb/couch_server_sup.erl b/src/couchdb/couch_server_sup.erl index 14849829..2de48d44 100644 --- a/src/couchdb/couch_server_sup.erl +++ b/src/couchdb/couch_server_sup.erl @@ -66,7 +66,7 @@ start_server(IniFiles) -> [io:format(" [~s] ~s=~p~n", [Module, Variable, Value]) || {{Module, Variable}, Value} <- couch_config:all()]; _ -> ok - end, + end, LibDir = case couch_config:get("couchdb", "util_driver_dir", null) of @@ -122,6 +122,13 @@ start_server(IniFiles) -> Port = mochiweb_socket_server:get(couch_httpd, port), io:format("Apache CouchDB has started. Time to relax.~n"), ?LOG_INFO("Apache CouchDB has started on http://~s:~w/", [Ip, Port]), + + case couch_config:get("couchdb", "uri_file", null) of + null -> ok; + UriFile -> + Line = io_lib:format("http://~s:~w/", [Ip, Port]), + file:write_file(UriFile, Line) + end, {ok, Pid}. -- cgit v1.2.3