I''ve got a mostly working puppet manifest for mysql, except for one problem. I''m using the RPM from the MySQL web site, and the packagers of this RPM in their infinite wisdom decided that the mysql service should be automatically started when the RPM was installed. This confuses puppet. The RPM is installed, and the service is started in quick succession. When puppet runs a ''service check mysql'', since mysql hasn''t fully completed it''s startup yet, the service script returns that MySQL isn''t running, and puppet goes ahead and starts a second copy. Any ideas of how to get around this? Doug --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Sun, 25 Oct 2009, Douglas Garstang wrote:> I''m using the RPM from the MySQL web site, and the packagers of this > RPM in their infinite wisdom decided that the mysql service should be > automatically started when the RPM was installed.MySQL installs and upgrades are hard to get right, and may need to do version updateing, or DB recovery, and such -- it is not an atomic operation and frankly cannot ever be. a PGSQL backend would be even harder ;)> This confuses > puppet. The RPM is installed, and the service is started in quick > succession. When puppet runs a ''service check mysql'', since mysql > hasn''t fully completed it''s startup yet, the service script returns > that MySQL isn''t running, and puppet goes ahead and starts a second > copy.seems to me like puppet needs to have a better retry mechanism to confirm a failure of a running database, rather than some hubris of ''infinite wisdom'' on a condrestart decsion in a server package install. Fixing the problem in puppet''s check by adding a backoff and retry a time or two on an asserted non-presence of the DB comes to mind. -- Russ herrold --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Actually, putting this in the service description seems to have fixed it. pattern => "/usr/bin/mysqld_safe" although, the darn thing really should not be started when the RPM is installed, because it isn''t even started with the service script. That''s pretty friggin stupid. I suppose that''s why puppet was failing earlier, since a ''service mysql status'' would have been stating mysql wasn''t running. Good grief! Doug On Sun, Oct 25, 2009 at 5:56 PM, R P Herrold <herrold@owlriver.com> wrote:> > On Sun, 25 Oct 2009, Douglas Garstang wrote: > >> I''m using the RPM from the MySQL web site, and the packagers of this >> RPM in their infinite wisdom decided that the mysql service should be >> automatically started when the RPM was installed. > > MySQL installs and upgrades are hard to get right, and may > need to do version updateing, or DB recovery, and such -- it > is not an atomic operation and frankly cannot ever be. a > PGSQL backend would be even harder ;) > >> This confuses >> puppet. The RPM is installed, and the service is started in quick >> succession. When puppet runs a ''service check mysql'', since mysql >> hasn''t fully completed it''s startup yet, the service script returns >> that MySQL isn''t running, and puppet goes ahead and starts a second >> copy. > > seems to me like puppet needs to have a better retry mechanism > to confirm a failure of a running database, rather than some > hubris of ''infinite wisdom'' on a condrestart decsion in a > server package install. > > Fixing the problem in puppet''s check by adding a backoff and > retry a time or two on an asserted non-presence of the DB > comes to mind. > > -- Russ herrold > > > >-- Regards, Douglas Garstang http://www.linkedin.com/in/garstang Email: doug.garstang@gmail.com Cell: +1-805-340-5627 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Sun, 25 Oct 2009, Douglas Garstang wrote:> Actually, putting this in the service description seems to have fixed it. > > pattern => "/usr/bin/mysqld_safe"It may have worked, but I guess I don''t seen how going around the LSB conformant services control model and forcing a start outside of the protections of the initscript is a win. -- Russ herrold --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
I don''t believe ''pattern'' is used to stop/start the service, only to help recognise if it''s running when hasstatus is not used. On Sun, Oct 25, 2009 at 6:14 PM, R P Herrold <herrold@owlriver.com> wrote:> > On Sun, 25 Oct 2009, Douglas Garstang wrote: > >> Actually, putting this in the service description seems to have fixed it. >> >> pattern => "/usr/bin/mysqld_safe" > > It may have worked, but I guess I don''t seen how going around > the LSB conformant services control model and forcing a start > outside of the protections of the initscript is a win. > > -- Russ herrold > > > >-- Regards, Douglas Garstang http://www.linkedin.com/in/garstang Email: doug.garstang@gmail.com Cell: +1-805-340-5627 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
doug.garstang@gmail.com (Douglas Garstang) writes:> I''ve got a mostly working puppet manifest for mysql, except for one problem. > > I''m using the RPM from the MySQL web site, and the packagers of this > RPM in their infinite wisdom decided that the mysql service should be > automatically started when the RPM was installed.See http://bugs.mysql.com/bug.php?id=27072 If you don''t like this behaviour tell Sun. I use something like this, simplified (somewhat) which causes no problems. # Installation of MySQL server binaries class mysql::server { package { [ "MySQL-server-communitiy" ]: ensure => installed, notify => Exec[ "chkconfig_mysql" ] } # Configure the service. # - Do NOT ensure enabled as this is carried out by chkconfig_mysql. service { "mysql": hasrestart => true, hasstatus => true, require => Package["MySQL-server-community"], } exec { "chkconfig_mysql": path => [ "/sbin", "/bin" ], command => "chkconfig --levels 345 mysql on", unless => "chkconfig --list mysql | grep -q ''3:$chkconfig_state.*4:$chkconfig_state.*5:on''", require => Package["MySQL-server-community"], } } Simon --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---