1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-05 12:02:47 +00:00

mysql/mysql55: Log to stderr instead of logfile.

This should integrate the logging more tightly into systemd, so for
example "systemctl status mysql" actually gives an overview about what's
actually going on.

This removes the logError option attribute, so in case you still want to
write into a logfile, I've introduced an option called extraOptions, so
you can use something like:

services.mysql*.extraOptions = ''
  log-error = /var/log/mysql_err.log
'';

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
aszlig 2013-07-14 01:47:40 +02:00
parent 8499959c4a
commit 916d39f5ce
No known key found for this signature in database
GPG key ID: D0EBD0EC8C2DC961
2 changed files with 36 additions and 12 deletions

View file

@ -12,7 +12,7 @@ let
mysqldOptions =
"--user=${cfg.user} --datadir=${cfg.dataDir} " +
"--log-error=${cfg.logError} --pid-file=${pidFile}";
"--pid-file=${pidFile}";
myCnf = pkgs.writeText "my.cnf"
''
@ -26,6 +26,7 @@ let
master-password = ${cfg.replication.masterPassword}
master-port = ${toString cfg.replication.masterPort}
''}
${cfg.extraOptions}
'';
in
@ -67,16 +68,27 @@ in
description = "Location where MySQL stores its table files";
};
logError = mkOption {
default = "/var/log/mysql_err.log";
description = "Location of the MySQL error logfile";
};
pidDir = mkOption {
default = "/var/run/mysql";
description = "Location of the file which stores the PID of the MySQL server";
};
extraOptions = mkOption {
default = "";
example = ''
key_buffer_size = 6G
table_cache = 1600
log-error = /var/log/mysql_err.log
'';
description = ''
Provide extra options to the MySQL configuration file.
Please note, that these options are added to the
<literal>[mysqld]</literal> section so you don't need to explicitly
state it again.
'';
};
initialDatabases = mkOption {
default = [];
description = "List of database names and their initial schemas that should be used to create databases on the first startup of MySQL";

View file

@ -12,13 +12,14 @@ let
mysqldOptions =
"--user=${cfg.user} --datadir=${cfg.dataDir} " +
"--log-error=${cfg.logError} --pid-file=${pidFile}";
"--pid-file=${pidFile}";
myCnf = pkgs.writeText "my.cnf"
''
[mysqld]
${optionalString (cfg.replication.role == "master" || cfg.replication.role == "slave") "log-bin=mysql-bin"}
${optionalString (cfg.replication.role == "master" || cfg.replication.role == "slave") "server-id = ${toString cfg.replication.serverId}"}
${cfg.extraOptions}
'';
in
@ -60,16 +61,27 @@ in
description = "Location where MySQL stores its table files";
};
logError = mkOption {
default = "/var/log/mysql_err.log";
description = "Location of the MySQL error logfile";
};
pidDir = mkOption {
default = "/var/run/mysql";
description = "Location of the file which stores the PID of the MySQL server";
};
extraOptions = mkOption {
default = "";
example = ''
key_buffer_size = 6G
table_cache = 1600
log-error = /var/log/mysql_err.log
'';
description = ''
Provide extra options to the MySQL configuration file.
Please note, that these options are added to the
<literal>[mysqld]</literal> section so you don't need to explicitly
state it again.
'';
};
initialDatabases = mkOption {
default = [];
description = "List of database names and their initial schemas that should be used to create databases on the first startup of MySQL";