Skip to content

Commit

Permalink
Merge pull request #1486 from puppetlabs/maint-harden_service_class
Browse files Browse the repository at this point in the history
Harden service class
  • Loading branch information
chelnak authored Aug 22, 2022
2 parents 1469fbf + cdaa839 commit 6f531ad
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions manifests/server/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,11 @@
$mysqlsocket = $options['mysqld']['socket']
}

$test_command = ['test', '-S', shell_escape($mysqlsocket)]
if $service_ensure != 'stopped' {
exec { 'wait_for_mysql_socket_to_open':
command => "test -S ${mysqlsocket}",
unless => "test -S ${mysqlsocket}",
command => $test_command,
unless => [$test_command],
tries => '3',
try_sleep => '10',
require => Service['mysqld'],
Expand Down

1 comment on commit 6f531ad

@markasammut
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit caused this issue on my setup:

Info: Loading facts
Error: Failed to apply catalog: Parameter command failed on Exec[wait_for_mysql_socket_to_open]: Command must be a String, got value of class Array (file: /etc/puppetlabs/code/modules/mysql/manifests/server/service.pp, line: 57)

Running puppet-agent-6.21.1-1.el7.x86_64

Please sign in to comment.