Merge pull request #784 from vicinus/master
ensure if service restart to wait till mysql is up
This commit is contained in:
commit
5e7b999615
1 changed files with 14 additions and 0 deletions
|
@ -49,4 +49,18 @@ class mysql::server::service {
|
||||||
File['mysql-config-file'] -> Service['mysqld']
|
File['mysql-config-file'] -> Service['mysqld']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $mysql::server::override_options and $mysql::server::override_options['mysqld'] and $mysql::server::override_options['mysqld']['socket'] {
|
||||||
|
$mysqlsocket = $mysql::server::override_options['mysqld']['socket']
|
||||||
|
} else {
|
||||||
|
$mysqlsocket = $options['mysqld']['socket']
|
||||||
|
}
|
||||||
|
|
||||||
|
exec { 'wait_for_mysql_socket_to_open':
|
||||||
|
command => "test -S ${mysqlsocket}",
|
||||||
|
unless => "test -S ${mysqlsocket}",
|
||||||
|
tries => '3',
|
||||||
|
try_sleep => '10',
|
||||||
|
require => Service['mysqld'],
|
||||||
|
path => '/bin:/usr/bin',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue