Issue #7165 has been updated by Nicholas Huanca.
Having the same issue, please see code below.
## Error from puppet agent -t --debug
info: Websaas::Load_static_conf_files[tomcat-users.xml]: Scheduling refresh of
Service[webservice-saas]
debug: Service[webservice-saas](provider=debian): Executing 'pgrep java'
debug: Service[webservice-saas](provider=debian): Executing
'/etc/init.d/webservice-saas start'
notice: /Stage[main]/Websaas::Token_service/Service[webservice-saas]/ensure:
ensure changed 'stopped' to 'running'
debug: /Stage[main]/Websaas::Token_service/Service[webservice-saas]: The
container Class[Websaas::Token_service] will propagate my refresh event
debug: Service[webservice-saas](provider=debian): Executing 'pgrep java'
debug: Service[webservice-saas](provider=debian): Executing
'/etc/init.d/webservice-saas stop'
err: /Stage[main]/Websaas::Token_service/Service[webservice-saas]: Failed to
call refresh: Could not stop Service[webservice-saas]: Execution of
'/etc/init.d/webservice-saas stop' returned 1: at
/etc/puppet/environments/passSplitNh/modules/Websaas/manifests/token_service.pp:115
## Resource causing dual restart
websaas::load_static_conf_files { $static_conf_files:
conf_dir => "$webservice_config_path",
notify => Service['webservice-saas'],
require => File["${webservice_config_path}"],
}
service { 'webservice-saas':
ensure => running,
enable => true,
status => 'pgrep java',
provider => debian,
require => Exec["install_package"],
}
----------------------------------------
Bug #7165: If services hasn’t started yet, where possible update the file first
and then start the service.
https://projects.puppetlabs.com/issues/7165#change-66951
Author: John Florian
Status: Needs More Information
Priority: Normal
Assignee: eric sorenson
Category: service
Target version:
Affected Puppet version: 0.25.5
Keywords:
Branch:
Given the following conditions:
1. service 'S' is currently disabled/stopped
1. config file 'F' for service 'S' is currently in state 'A'
1. puppet class 'C' calls for 'S' to be enabled/running and 'F' to be in state
'B'
When puppet runs, the following currently occurs:
<pre>
notice: //C/File[F]/content: content changed '{md5}-A' to '{md5}-B'
info: //C/File[F]: Scheduling refresh of Service[S]
notice: //C/Service[S]/ensure: ensure changed 'stopped' to 'running'
notice: //C/Service[S]: Triggering 'refresh' from 1 dependencies
</pre>
Thus, puppet sees the service is to be running and makes it so. Then it
realizes that a refresh is needed and so restarts the service. The restart is
unnecessary in this case. Depending on the particular service, this could be
quite undesirable. Puppet should be able to recognize this case and simply
start the service just once.
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.