Merge pull request #6283 from mdorman/master

Fix initial-install issues with couchdb.nix.

lethalman b6672f23 02971cd5

+6 -3
+6 -3
nixos/modules/services/databases/couchdb.nix
··· 131 131 type = types.string; 132 132 default = "/var/lib/couchdb/couchdb.ini"; 133 133 description = '' 134 - Custom configuration file. File needs to be readable and writable 135 - from couchdb user/group. 134 + Configuration file for persisting runtime changes. File 135 + needs to be readable and writable from couchdb user/group. 136 136 ''; 137 137 }; 138 138 ··· 157 157 mkdir -p ${cfg.databaseDir}; 158 158 mkdir -p ${cfg.viewIndexDir}; 159 159 touch ${cfg.configFile} 160 + touch -a ${cfg.logFile} 160 161 161 162 if [ "$(id -u)" = 0 ]; then 162 - chown ${cfg.user}:${cfg.group} ${cfg.uriFile} 163 + chown ${cfg.user}:${cfg.group} `dirname ${cfg.uriFile}`; 164 + (-f ${cfg.uriFile} && chown ${cfg.user}:${cfg.group} ${cfg.uriFile}) || true 163 165 chown ${cfg.user}:${cfg.group} ${cfg.databaseDir} 164 166 chown ${cfg.user}:${cfg.group} ${cfg.viewIndexDir} 165 167 chown ${cfg.user}:${cfg.group} ${cfg.configFile} 168 + chown ${cfg.user}:${cfg.group} ${cfg.logFile} 166 169 fi 167 170 ''; 168 171