couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From beno...@apache.org
Subject svn commit: r960087 - in /couchdb/trunk: etc/couchdb/default.ini.tpl.in src/couchdb/couch_server_sup.erl
Date Fri, 02 Jul 2010 18:59:30 GMT
Author: benoitc
Date: Fri Jul  2 18:59:29 2010
New Revision: 960087

URL: http://svn.apache.org/viewvc?rev=960087&view=rev
Log:
close #COUCHDB-393. save the uri http://IP:PORT/ in
%localstatelibdir%/couch.uri  when
couchdb start.

Modified:
    couchdb/trunk/etc/couchdb/default.ini.tpl.in
    couchdb/trunk/src/couchdb/couch_server_sup.erl

Modified: couchdb/trunk/etc/couchdb/default.ini.tpl.in
URL: http://svn.apache.org/viewvc/couchdb/trunk/etc/couchdb/default.ini.tpl.in?rev=960087&r1=960086&r2=960087&view=diff
==============================================================================
--- couchdb/trunk/etc/couchdb/default.ini.tpl.in (original)
+++ couchdb/trunk/etc/couchdb/default.ini.tpl.in Fri Jul  2 18:59:29 2010
@@ -11,6 +11,7 @@ max_attachment_chunk_size = 4294967296 ;
 os_process_timeout = 5000 ; 5 seconds. for view and external servers.
 max_dbs_open = 100
 delayed_commits = true ; set this to false to ensure an fsync before 201 Created is returned
+uri_file = %localstatelibdir%/couch.uri
 
 [httpd]
 port = 5984

Modified: couchdb/trunk/src/couchdb/couch_server_sup.erl
URL: http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_server_sup.erl?rev=960087&r1=960086&r2=960087&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_server_sup.erl (original)
+++ couchdb/trunk/src/couchdb/couch_server_sup.erl Fri Jul  2 18:59:29 2010
@@ -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}.
 



Mime
View raw message