Skip to content
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

move out $options['mysqld']['log-error'] from service.pp into installdb.pp #833

Merged
merged 3 commits into from
May 19, 2016

Conversation

ndelic0
Copy link
Contributor

@ndelic0 ndelic0 commented May 6, 2016

Installation of Percona-Server-57 from yum repository has a side effect - touching of /var/log/mysqld.log. The file is empty and owned by root user, and that prevents mysql datadir initialization.

puppet-agent[2003]: Execution of '/usr/sbin/mysqld --initialize-insecure --basedir=/usr --datadir=/var/lib/mysql --user=mysql --log-error=/var/lib/mysql/mysqld.log' returned 1
.
Given issue reproduced on CentOS 6.7, possibly on CentOS7.

@ndelic0 ndelic0 changed the title move out $options['mysqld']['log-error'] from service.pp intto installdb.pp move out $options['mysqld']['log-error'] from service.pp into installdb.pp May 6, 2016
@jonnytdevops
Copy link
Contributor

Hey There

Thanks for your contribution!

Are you sure this isn't more of a bug/issue with Percona-Server-57? Can you please explain how moving the resource from one pp to the other solves this?

Thanks!

@ndelic0
Copy link
Contributor Author

ndelic0 commented May 10, 2016

Hi jonnytpuppet!

It's a bug with a yum installer. By managing log_error file inside of installdb class we're only changing file ownership, prior to mysql_datadir resource declaration, thus ensuring that mysql --initialize-insecure actually succeed.
The way I see, though it is a bug with the installer, we're not modifying module logic here, just securing it.

@jonnytdevops
Copy link
Contributor

Hi There

This is not the correct place to move the file resource. It may fix your solution, however then we run the risk of the file not being managed properly.

What we should do, it make the datadir resource depend on the logfile resource (inside the service class).

Thanks

@ndelic0
Copy link
Contributor Author

ndelic0 commented May 17, 2016

Hi JT,

Not sure I got this one. If you're suggesting adding dependency for logfile resource inside service class, basically something like this

if $options['mysqld']['log-error'] { file { $options['mysqld']['log-error']: ensure => present, owner => $mysqluser, group => $::mysql::server::mysql_group, before => Mysql_datadir[ $options['mysqld']['datadir'] ], }

smells like a dependency cycle here

Class['mysql::server::installdb'] -> Class['mysql::server::service'] ->

@bmjen bmjen merged commit 352d078 into puppetlabs:master May 19, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants