Commit Graph

63 Commits

Author SHA1 Message Date
Aaron Andersen
df059f89e6 nixos/mysql: restart systemd service on abort 2020-01-06 20:08:51 -05:00
Silvan Mosberger
4ee3e8b21d
nixos/treewide: Move rename.nix imports to their respective modules
A centralized list for these renames is not good because:
- It breaks disabledModules for modules that have a rename defined
- Adding/removing renames for a module means having to find them in the
central file
- Merge conflicts due to multiple people editing the central file
2019-12-10 02:51:19 +01:00
John Ericson
d0d5136cce Merge remote-tracking branch 'upstream/master' into wrapper-pname-support 2019-11-24 17:25:07 +00:00
John Ericson
9b090ccbca treewide: Get rid of most parseDrvName without breaking compat
That is because this commit should be merged to both master and
release-19.09.
2019-11-24 17:22:28 +00:00
Izorkin
632f69e485 nixos/mysql: fix mysqlReplication test 2019-10-13 19:18:51 +03:00
Thorsten Weber
46ea3ebc19 nixos/mysql: make ExecStartPost script fail on error 2019-07-03 08:50:21 +02:00
Aaron Andersen
d0a147e841 nixos/mysql: run ExecStartPost as root (again) to preserve compatibility with installs that have been secured 2019-06-30 21:59:47 -04:00
Aaron Andersen
e0590da813 nixos/mysql: turn ExecStartPost into a shell script and simplify code 2019-06-30 21:58:27 -04:00
Aaron Andersen
fb918a9254 nixos/mysql: drop rootPassword option 2019-06-25 17:26:53 -04:00
Florian Klink
5ea7a3eb21 nixos/mysql: drop services.mysql.pidDir
mysql already has its socket path hardcoded to to
/run/mysqld/mysqld.sock.
There's not much value in making the pidDir configurable, which also
points to /run/mysqld by default.

We only seem to use `services.mysql.pidDir` in the wordpress startup
script, to wait for mysql to boot up, but we can also simply wait on the
(hardcoded) socket location too.

A much nicer way to accomplish that would be to properly describe a
dependency on mysqld.service. This however is not easily doable, due to
how the apache-httpd module was designed.
2019-05-31 22:27:55 +02:00
Florian Klink
edd10c12f7 nixos/mysql: run as mysql user and group
As we don't need to setup data directories from ExecStartPre= scripts
anymore, which required root, but use systemd.tmpfiles.rules instead,
everything can be run as just the mysql user.
2019-05-31 22:27:55 +02:00
Florian Klink
25494cc193 nixos/mysql: reformat, move logical steps into variables
define commands like "waiting for the mysql socket to appear" or "setup
initial databases" in a let expression, so the main control flow becomes
more readable.
2019-05-31 22:27:48 +02:00
Florian Klink
50dda813e2 nixos/mysql: use systemd.tmpfiles to setup dataDir and pidDir
We need to keep using `RuntimeDirectory=mysqld`, which translates to
`/run/mysqld`, as this is used for the location of the file socket, that
could differ with what is configured via `cfg.pidDir`.
2019-05-31 22:20:42 +02:00
Florian Jacob
14571f5ed0 nixos/mysql: fix initialScript option
which was wrongly specified as types.lines
Prevent it from getting copied to nix store as people might use it for
credentials, and make the tests cover it.
2019-04-01 21:08:47 +02:00
Florian Jacob
77978c1518 nixos/mysql: fix support for non-specified database schema
and increase test coverage to catch this
2019-04-01 20:01:29 +02:00
Florian Jacob
5bec5e8cb1 nixos/mysql: specify option types 2019-03-15 16:32:36 +01:00
Silvan Mosberger
997cd3159e
Merge pull request #54475 from Izorkin/mysql-restartTrigger
mysql: add restartTrigger for my.cnf
2019-01-29 19:54:24 +01:00
Janne Heß
9a1b53304a nixos/mysql: Support bootstrapping a Galera cluster
The default galera_new_cluster script tries to set this environment
variable using systemctl set-environment which doesn't work if the
variable is not being used in the unit file ;)
2019-01-24 17:39:19 +01:00
Izorkin
ea02ddc0be mysql: add restartTrigger for my.cnf 2019-01-22 21:05:21 +03:00
Robin Stumm
429c0bf60c nixos/mysql: fix option ensureDatabases
The database name needs to be quoted
in case it contains special characters
so the MySQL service does not fail to start.
2019-01-17 19:08:50 +01:00
Izorkin
953be3e283 mariadb: change location configuration file to /etc/my.cnf 2018-12-02 22:15:02 +03:00
Linus Heckemann
388d36951c
Merge pull request #49735 from pvgoran/mysql-support-mysql57
nixos/mysql: support package=mysql57
2018-11-19 20:49:08 +01:00
Pavel Goran
21e9c35f5f nixos/mysql: support package=mysql57 2018-11-18 12:25:36 +07:00
Samuel Dionne-Riel
07eaaf6c8b
Merge pull request #49838 from dasJ/mysql-datadir
nixos/mysql: Explicitly set datadir in my.cnf
2018-11-16 19:21:01 +00:00
Ryan Mulligan
23dfa4e073 nixos/mysql: fix ensureUsers example formatting
closes #50441
2018-11-15 17:46:09 -08:00
Janne Heß
c7f5457aa6 nixos/mysql: Explicitly set datadir in my.cnf
While this seems silly at first (it's already given as start parameter
to mysqld), it seems like xtrabackup needs that sometimes.
Without it, a Galera cluster cannot be run using the xtrabackup
replication method.
2018-11-06 18:38:28 +01:00
Tuomas Tynkkynen
96190535e5 Revert "nixos: rename system.{stateVersion,defaultChannel} -> system.nixos.\1"
This reverts commit 095fe5b43def40279a243e663c662b02caac5318.

Pointless renames considered harmful. All they do is force people to
spend extra work updating their configs for no benefit, and hindering
the ability to switch between unstable and stable versions of NixOS.

Like, what was the value of having the "nixos." there? I mean, by
definition anything in a NixOS module has something to do with NixOS...
2018-07-28 00:12:55 +03:00
Florian Klink
fff5923686 nixos/modules: users.(extraUsers|extraGroup->users|group) 2018-06-30 03:02:58 +02:00
Peter Hoeg
5b468ea6b1 nixos mysql: make start-up more robust (#41010)
1) Change start-type to ```notify``` when running MariaDB so that we don't have to busy-wait for the
socket to appear.

2) Do not manually create the directory under /run as we can get systemd to do
that for us. This opens up the possibility later for not having to launch as root.
2018-05-24 16:42:16 +02:00
Jan Malakhovski
095fe5b43d nixos: rename system.{stateVersion,defaultChannel} -> system.nixos.\1 2018-05-12 19:27:09 +00:00
Franz Pletz
37c009ca74
Merge pull request #34028 from florianjacob/matomo
piwik is now matomo
2018-02-26 06:53:58 +00:00
Sarah Brofeldt
2ea8f8acdf nixos/mysql: Unbreak initial database creation 2018-02-24 20:07:55 +01:00
Florian Jacob
48e449ee70 nixos/piwik: rename to matomo 2018-02-22 22:03:55 +01:00
Eric Bailey
6b45dbd99c services.mysql: properly quote database.name 2018-02-08 17:32:41 +01:00
Robin Gloster
86c7db0ac4 mysql module: cleanup obsolete checks 2017-12-29 02:18:35 +01:00
Danylo Hlynskyi
9f7315caf2
mysql module: fix flaky check
Comparing packages via equality will lead to different results when package and module are from different
`nixpkgs` checkouts.

Also, because MariaDB is actually supported, added a note to option description to make this knowledge more discover-able.
2017-11-14 03:08:15 +02:00
Raphael Das Gupta
27c8fd24e5 nixos/mysql: fix typo in description of mysql.bind option 2017-11-07 11:09:40 +01:00
Florian Jacob
839e3c7666 nixos/mysql: declarative users & databases
using Unix socket authentication, ensured on every rebuild.
2017-09-18 13:10:26 +02:00
Florian Jacob
d22c1c0719 mysql service: Make initialDatabases.schema attribute optional 2017-08-31 11:32:25 +02:00
Maarten Hoogendoorn
d847b5c763 mysql module: add option to bind to an address 2017-06-15 16:08:15 +02:00
Pascal Bach
f469bd83bb mysql service: change default data directory for 17.09
The new directory is now moved to /var/lib/mysql. This makes it consistent with
with upstream.
2017-05-20 15:46:13 +02:00
Joachim Fasting
142930113c
Revert "mysql service: specify a default package"
This reverts commit 4358d3d43938666834d3e1fd5a8ea69b49c08112.

Not having a default was deliberate, see
1ce6fff4e2

Thanks to @ocharles for making me aware of this.
2016-12-17 22:36:38 +01:00
Joachim Fasting
c2219007e8
Revert "mysql service: specify defaultText for package option"
This reverts commit 52d12b473af0dfbf7f5af1bd75ac5a5f2366f887.
2016-12-17 22:36:15 +01:00
Joachim Fasting
52d12b473a
mysql service: specify defaultText for package option
Also provide an example that differs from the default.
2016-10-09 11:28:51 +02:00
Joachim Fasting
4358d3d439
mysql service: specify a default package
A config ought to be buildable using just the defaults.
2016-10-03 23:08:32 +02:00
Joachim Fasting
c2153538d9
mysql service: add some option types
Note that this changes the type and default value of port to int
(previously default was a string, no type).
2016-10-03 23:08:31 +02:00
Joachim Fasting
88265c8238
mysql service: order after network.target 2016-10-03 23:08:26 +02:00
ben smith
c38e6a2a60 mysql: fix replication tests (#17174)
Eliminate race condition in replication test
Remove replication configuration from standalone test
Improve mysql command syntax consistency
2016-07-23 00:37:05 +02:00
ben smith
e641974f06 MySQL Replication (that actually works) (#7198)
Improves replication functionality by:
 * adding slaveHost on the 'master' role
 * adds slave user to master with replication only permissions
2016-07-21 02:15:55 +02:00
Bas van Dijk
1f1e02daad mysql: add nettools to path
The mysql_install_db command, called in preStart, needs the hostname command.
2015-09-08 10:32:37 +02:00