couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject [6/13] git commit: More environment variables for the daemon
Date Wed, 13 Feb 2013 13:17:14 GMT
More environment variables for the daemon


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/f638bc14
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/f638bc14
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/f638bc14

Branch: refs/heads/nodejs_couchdb
Commit: f638bc143b7550d8f5472046ea4d8063f239859d
Parents: 2853a11
Author: Jason Smith (work) <jhs@iriscouch.com>
Authored: Tue Feb 12 14:05:48 2013 +0000
Committer: Jason Smith (work) <jhs@iriscouch.com>
Committed: Tue Feb 12 14:05:48 2013 +0000

----------------------------------------------------------------------
 src/couchdb/couch_os_daemons.erl |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/f638bc14/src/couchdb/couch_os_daemons.erl
----------------------------------------------------------------------
diff --git a/src/couchdb/couch_os_daemons.erl b/src/couchdb/couch_os_daemons.erl
index a11818b..f832661 100644
--- a/src/couchdb/couch_os_daemons.erl
+++ b/src/couchdb/couch_os_daemons.erl
@@ -195,6 +195,7 @@ code_change(_OldVsn, State, _Extra) ->
 
 start_port(?NODEJS_EXTRA) ->
     Port = couch_config:get("httpd", "port"),
+    PrivDir = couch_util:priv_dir(),
 
     % This is kind of bad. The environment variable is ok for the child,
     % however it also sets for this process. The only reason is to
@@ -209,7 +210,11 @@ start_port(?NODEJS_EXTRA) ->
             Found
     end,
 
-    Env = [ {"_couchdb_port",Port}, {"_couchdb_password",Password} ],
+    GitPort1 = 10000 + random:uniform(10000) * 2,
+    GitPort = integer_to_list(GitPort1),
+
+    Env = [ {"_couchdb_port",Port}, {"_couchdb_password",Password},
+            {"_couchdb_git_port",GitPort}, {"_couchdb_priv_dir",PrivDir} ],
     start_port(?NODEJS_EXTRA, Env);
 
 start_port(Command) ->


Mime
View raw message