Github user wtogami commented on the pull request:
https://github.com/apache/couchdb/pull/257#issuecomment-48139622
@rnewson
Somehow both your and Peter's patch result in default.ini being opened for
write.
```
diff --git a/src/couchdb/couch_app.erl b/src/couchdb/couch_app.erl
index d6d8c0c..9e5d7b5 100644
--- a/src/couchdb/couch_app.erl
+++ b/src/couchdb/couch_app.erl
@@ -38,7 +38,8 @@ get_ini_files(Default) ->
{ok, [[]]} ->
Default;
{ok, [Values]} ->
- lists:flatmap(fun(V) ->
+ io:fwrite("INIT CHAIN: ~p~n", [Values]),
+ R = lists:flatmap(fun(V) ->
case file:read_file_info(V) of
{ok, #file_info{type = regular}} ->
[V];
@@ -47,7 +48,9 @@ get_ini_files(Default) ->
{error, enoent} ->
[]
end
- end, Values)
+ end, Values),
+ io:fwrite("RESULT CHAIN: ~p~n", [R]),
+ R
end.
start_apps([]) ->
```
The above patch applied on top of your patch confirms that default.ini is
first.
```
RESULT CHAIN: ["/etc/couchdb/default.ini","/etc/couchdb/default.d/1.ini",
"/etc/couchdb/default.d/2.ini","/etc/couchdb/default.d/3.ini",
"/etc/couchdb/local.d/1.ini","/etc/couchdb/local.d/2.ini",
"/etc/couchdb/local.d/3.ini","/etc/couchdb/local.ini"]
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---