The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

This issue tracker is now in read-only archive mode and automatic ticket export has been disabled. Redmine users will need to create a new JIRA account to file tickets using https://tickets.puppetlabs.com. See the following page for information on filing tickets with JIRA:

Bug #19562

Mysql module has hard-coded restart somewhere, discovered while using Percona

Added by Anonymous about 3 years ago. Updated about 3 years ago.

Status:UnreviewedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:mysqlSpent time:-
Target version:-
Keywords: Branch:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com


Description

While using the mysql module on CentOS 6.3 x64 if I add a yum repository for Percona and then change the package name to the respective packages and the service name to ‘mysql’ I still see the module referencing ‘mysqld’ which is the default service name for mysql server packages on CentOS. Percona uses just ‘mysql’ and subsequently things don’t get applied correctly. I am, however, able to login and restart the mysql service forcefully and it appears things work thereafter. Obviously this is not ideal. For the time being I’ve been able to use a workaround by creating a symlink for /etc/init.d/mysqld –> /etc/init.d/mysql before any of the mysql classes run. Again though, this does not seem ideal.

I am including the output from puppet below so you can see my error. Additionally you can find a test config I used to verify the issue I am encountering here: https://gist.github.com/anonymous/5082687

Please note I am seeing this issue with 0.6.1 of the mysql module, I did not experience this issue previously when I was using 0.4.0. I am using a Vagrant image to test this, the base box can be found at: http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.3-x86_64-v20130101.box

[default] Running Puppet with /tmp/vagrant-puppet/manifests/site.pp… Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults

Notice: /Stage[main]//Yumrepo[percona]/descr: descr changed ‘’ to ‘Percona Server’

Notice: /Stage[main]//Yumrepo[percona]/baseurl: baseurl changed ‘’ to ‘http://repo.percona.com/centos/$releasever/os/$basearch/’

Notice: /Stage[main]//Yumrepo[percona]/enabled: enabled changed ‘’ to ‘1’

Notice: /Stage[main]//Yumrepo[percona]/gpgcheck: gpgcheck changed ‘’ to ‘0’

Notice: /Stage[main]/Mysql::Server/Package[mysql-server]/ensure: created

Notice: /Stage[main]/Mysql::Server/Service[mysqld]/ensure: ensure changed ‘stopped’ to ‘running’

Notice: /Stage[main]//Database[test]/charset: charset changed ‘latin1’ to ‘utf8’ Notice: /Stage[main]//Database_user[test@localhost]/ensure: created Notice: /Stage[main]//Database_grant[test@localhost/test]/privileges: privileges changed ‘’ to ‘all’ Notice: /Stage[main]/Mysql::Config/File[/etc/mysql]/ensure: created

Notice: /Stage[main]/Mysql::Config/File[/etc/my.cnf]/ensure: defined content as ‘{md5}5d82fb02f1a26f415012f00f63b1f87f’

Notice: /Stage[main]/Mysql::Config/File[/root/.my.cnf]/ensure: created

Notice: /Stage[main]/Mysql::Config/File[/etc/mysql/conf.d]/ensure: created

Notice: /Stage[main]/Mysql::Config/Exec[mysqld-restart]/returns: mysqld: unrecognized service

Error: /Stage[main]/Mysql::Config/Exec[mysqld-restart]: Failed to call refresh: service mysqld restart returned 1 instead of one of [0]

Error: /Stage[main]/Mysql::Config/Exec[mysqld-restart]: service mysqld restart returned 1 instead of one of [0]

Notice: Finished catalog run in 398.49 seconds

History

#1 Updated by Anonymous about 3 years ago

Also note, it appears that the pid file needs to be changed for this to work also:

class { 'mysql::server': 
  require   => [ Yumrepo["Percona"], File['/etc/init.d/mysqld'] ],
  package_name => 'Percona-Server-server-55',
  package_ensure => latest,
  service_name => 'mysql',
  config_hash => {
    'pidfile'     => '/var/lib/mysql/localhost.localdomain.pid',
    'bind_address' => '0.0.0.0',
  },
}

#2 Updated by Trung Hoang about 3 years ago

I commented in another bug request (https://projects.puppetlabs.com/issues/15632#change-84740), but i’ll repeat it here also.

I’ve found that the only way I could get this to work is to specify service_name it both at the class level and inside the config_hash.

class { 'mysql::server':
  package_name => 'Percona-Server-server-55',
  service_name => 'mysql',
  config_hash => {
    'root_password' => 'some-root-pass',
    'service_name' => 'mysql',
  }
  require => File['/var/run/mysqld'],
}

Quite odd.. is this by design as it’s not very DRY?

#3 Updated by Anonymous about 3 years ago

Trung Hoang wrote:

I’ve found that the only way I could get this to work is to specify service_name it both at the class level and inside the config_hash.

That will get it installed and running, but in my experience thus far you still have to get on and manually restart the service.

Also available in: Atom PDF