mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-11-06 10:16:44 +01:00
nixos/couchdb: Prevent it from chowning /var/log to couchdb:couchdb
The default for logFile is /var/log/couchdb.log, and the tmpfile rules chown ${dirOf cfg.logFile}, which is just /var/log, to couchdb:couchdb. This was found by Edes' report on IRC, which looked like Detected unsafe path transition /var/log → /var/log/journal during canonicalization of /var/log/journal While this bug has been present since the initial couchdb module in62438c09f7
by @garbas, this wasn't a problem, because the initial module only created and chowned /var/log if it didn't exist yet, which can't occur because this gets created in the initial phases of NixOS startup. However with the recent move from manual preStart chown scripts to systemd.tmpfiles.rules in062efe018d
(#59389), this chown is suddenly running unconditionally at every system activation, therefore triggering the above error.
This commit is contained in:
parent
4ec8edaa6a
commit
5e974362be
|
@ -160,7 +160,7 @@ in {
|
||||||
|
|
||||||
systemd.tmpfiles.rules = [
|
systemd.tmpfiles.rules = [
|
||||||
"d '${dirOf cfg.uriFile}' - ${cfg.user} ${cfg.group} - -"
|
"d '${dirOf cfg.uriFile}' - ${cfg.user} ${cfg.group} - -"
|
||||||
"d '${dirOf cfg.logFile}' - ${cfg.user} ${cfg.group} - -"
|
"f '${cfg.logFile}' - ${cfg.user} ${cfg.group} - -"
|
||||||
"d '${cfg.databaseDir}' - ${cfg.user} ${cfg.group} - -"
|
"d '${cfg.databaseDir}' - ${cfg.user} ${cfg.group} - -"
|
||||||
"d '${cfg.viewIndexDir}' - ${cfg.user} ${cfg.group} - -"
|
"d '${cfg.viewIndexDir}' - ${cfg.user} ${cfg.group} - -"
|
||||||
];
|
];
|
||||||
|
@ -169,10 +169,8 @@ in {
|
||||||
description = "CouchDB Server";
|
description = "CouchDB Server";
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
|
||||||
preStart =
|
preStart = ''
|
||||||
''
|
|
||||||
touch ${cfg.configFile}
|
touch ${cfg.configFile}
|
||||||
touch -a ${cfg.logFile}
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
environment = mkIf useVersion2 {
|
environment = mkIf useVersion2 {
|
||||||
|
|
Loading…
Reference in a new issue