-
-
Notifications
You must be signed in to change notification settings - Fork 15.4k
nixos/mysql: fix service so it works with mysql80 package [20.03 backport] #83254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@GrahamcOfBorg test mysql |
ping @NixOS/nixos-release-managers - currently |
preStart = if isMariaDB then '' | ||
if ! test -e ${cfg.dataDir}/mysql; then | ||
${mysql}/bin/mysql_install_db --defaults-file=/etc/my.cnf ${mysqldOptions} | ||
touch /tmp/mysql_init | ||
fi | ||
'' else '' | ||
if ! test -e ${cfg.dataDir}/mysql; then | ||
${mysql}/bin/mysql_install_db --defaults-file=/etc/my.cnf ${installOptions} | ||
${mysql}/bin/mysqld --defaults-file=/etc/my.cnf ${mysqldOptions} --initialize-insecure | ||
touch /tmp/mysql_init | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is slightly duplicated, why not do
preStart =
let
initCommand = if isMariaDB then ''
${mysql}/bin/mysql_install_db --defaults-file=/etc/my.cnf ${mysqldOptions}
'' else "${mysql}/bin/mysqld --defaults-file=/etc/my.cnf ${mysqldOptions} --initialize-insecure";
in ''
if ! test -e ${cfg.dataDir/mysql; then
${initCommand}
touch /tmp/mysql_init
fi
'';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As time goes by mariadb
and mysql
drift further apart so I figured in this case maybe just keep it separate in case there is more divergence... but yeah maybe it was a bit much and a bit premature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As time goes by mariadb and mysql drift further apart so I figured in this case maybe just keep it separate in case there is more divergence...
That is a good point, this is probably fine if the actual conditional changes.
Lol, this is a cherry-pick. Didn't realize this right away (probably should read closer). |
Motivation for this change
I found out that the
mysql80
package is broken with themysql
module 😱 I think this deserves a20.03
backport.Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)