From 5cd565e507c1655800fa76bd06c707994ac0df32 Mon Sep 17 00:00:00 2001 From: Eric Sagnes Date: Wed, 14 Sep 2016 11:58:29 +0900 Subject: [PATCH 1/2] mongodb service: switch configuration format to YAML Configuration format has changed from MongoDB 2.6 to YAML and MongoDB 2.4 is EOL since March 2016. --- nixos/doc/manual/release-notes/rl-1609.xml | 5 +++++ nixos/modules/services/databases/mongodb.nix | 18 ++++++++---------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-1609.xml b/nixos/doc/manual/release-notes/rl-1609.xml index 988e57caf10..4d210cf0c2b 100644 --- a/nixos/doc/manual/release-notes/rl-1609.xml +++ b/nixos/doc/manual/release-notes/rl-1609.xml @@ -106,6 +106,11 @@ following incompatible changes: tool introduced to generate Go package definition from its Go source automatically. + + services.mongodb.extraConfig configuration format + was changed to YAML. + + diff --git a/nixos/modules/services/databases/mongodb.nix b/nixos/modules/services/databases/mongodb.nix index ef9bc46e4a0..38e46a0c6ef 100644 --- a/nixos/modules/services/databases/mongodb.nix +++ b/nixos/modules/services/databases/mongodb.nix @@ -12,13 +12,11 @@ let mongoCnf = pkgs.writeText "mongodb.conf" '' - bind_ip = ${cfg.bind_ip} - ${optionalString cfg.quiet "quiet = true"} - dbpath = ${cfg.dbpath} - syslog = true - fork = true - pidfilepath = ${cfg.pidFile} - ${optionalString (cfg.replSetName != "") "replSet = ${cfg.replSetName}"} + net.bindIp: ${cfg.bind_ip} + ${optionalString cfg.quiet "systemLog.quiet: true"} + systemLog.destination: syslog + storage.dbPath: ${cfg.dbpath} + ${optionalString (cfg.replSetName != "") "replication.replSetName: ${cfg.replSetName}"} ${cfg.extraConfig} ''; @@ -84,9 +82,9 @@ in extraConfig = mkOption { default = ""; example = '' - nojournal = true + storage.journal.enabled: false ''; - description = "MongoDB extra configuration"; + description = "MongoDB extra configuration in YAML format"; }; }; @@ -112,7 +110,7 @@ in after = [ "network.target" ]; serviceConfig = { - ExecStart = "${mongodb}/bin/mongod --quiet --config ${mongoCnf}"; + ExecStart = "${mongodb}/bin/mongod --quiet --config ${mongoCnf} --fork --pidfilepath ${cfg.pidFile}"; User = cfg.user; PIDFile = cfg.pidFile; Type = "forking"; From 9132088dab08abab9107e285db64f3f8f7dbd7c5 Mon Sep 17 00:00:00 2001 From: Eric Sagnes Date: Wed, 14 Sep 2016 12:04:29 +0900 Subject: [PATCH 2/2] pump.io test: adapt mongodb extraConf to YAML --- nixos/tests/pump.io.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/tests/pump.io.nix b/nixos/tests/pump.io.nix index 3864f676497..18da52b5134 100644 --- a/nixos/tests/pump.io.nix +++ b/nixos/tests/pump.io.nix @@ -77,7 +77,7 @@ in { }; }; mongodb.enable = true; mongodb.extraConfig = '' - nojournal = true + storage.journal.enabled: false ''; }; systemd.services.mongodb.unitConfig.Before = "pump.io.service";