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.
This commit is contained in:
Eric Sagnes 2016-09-14 11:58:29 +09:00
parent 48999a953b
commit 5cd565e507
2 changed files with 13 additions and 10 deletions

View File

@ -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>

View File

@ -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";