Skip to content

Commit

Permalink
mongodb service: switch configuration format to YAML
Browse files Browse the repository at this point in the history
Configuration format has changed from MongoDB 2.6 to
YAML and MongoDB 2.4 is EOL since March 2016.

(cherry picked from commit 5cd565e)
Signed-off-by: Domen Kožar <domen@dev.si>
  • Loading branch information
ericsagnes authored and domenkozar committed Sep 22, 2016
1 parent faf6fef commit a64de3e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
5 changes: 5 additions & 0 deletions nixos/doc/manual/release-notes/rl-1609.xml
Expand Up @@ -106,6 +106,11 @@ following incompatible changes:</para>
tool introduced to generate Go package definition from its Go source automatically.</para>
</listitem>

<listitem>
<para><literal>services.mongodb.extraConfig</literal> configuration format
was changed to YAML.</para>
</listitem>

</itemizedlist>


Expand Down
18 changes: 8 additions & 10 deletions nixos/modules/services/databases/mongodb.nix
Expand Up @@ -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}
'';

Expand Down Expand Up @@ -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";
};
};

Expand All @@ -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";
Expand Down

0 comments on commit a64de3e

Please sign in to comment.