Issue #7165 has been updated by Ben Hughes.
Category set to service
Status changed from Unreviewed to Needs Decision
Assignee set to Nigel Kersten
Thanks for the report.
Same behaviour on 2.6.x (tested on 2.6.7 on Ubuntu 10.10)
Steps to repeat:
<pre>
[ben@ubuntu:~]% cat serv.pp
# service ’S' is currently disabled/stopped
# config file ‘F’ for service ’S' is currently in state ‘A’
# puppet class ‘C’ calls for ’S' to be enabled/running and ‘F’ to be in state
‘B’
class myclass {
service{ 'nginx':
hasstatus => true,
hasrestart => true,
ensure => running,
}
file{ '/etc/nginx/magic':
source => '/tmp/magic',
notify => Service['nginx'],
}
}
node default {
include myclass
}
<pre>
And running it we have:
<pre>
[root@ubuntu:~]# invoke-rc.d nginx stop ; dd if=/dev/urandom of=/tmp/magic
count=1 2>/dev/null ; puppet apply -vd serv.pp
Stopping nginx: nginx.
[snip.....]
debug: Finishing transaction -610590378
debug: Loaded state in 0.00 seconds
debug: /Stage[main]/Myclass/File[/etc/nginx/magic]/notify: subscribes to
Service[nginx]
info: Applying configuration version '1302609983'
debug: Finishing transaction -611191178
info: FileBucket adding /etc/nginx/magic as
{md5}4545b51920720e13c935b8e5a8f7e56b
info: /Stage[main]/Myclass/File[/etc/nginx/magic]: Filebucketed
/etc/nginx/magic to puppet with sum 4545b51920720e13c935b8e5a8f7e56b
notice: /Stage[main]/Myclass/File[/etc/nginx/magic]/content: content changed
'{md5}4545b51920720e13c935b8e5a8f7e56b' to
'{md5}982730c01371ab19d9e5093a947ad2a5'
info: /Stage[main]/Myclass/File[/etc/nginx/magic]: Scheduling refresh of
Service[nginx]
debug: Service[nginx](provider=debian): Executing '/etc/init.d/nginx status'
debug: Service[nginx](provider=debian): Executing '/etc/init.d/nginx start'
notice: /Stage[main]/Myclass/Service[nginx]/ensure: ensure changed 'stopped' to
'running'
debug: Service[nginx](provider=debian): Executing '/etc/init.d/nginx status'
debug: Service[nginx](provider=debian): Executing '/etc/init.d/nginx restart'
notice: /Stage[main]/Myclass/Service[nginx]: Triggered 'refresh' from 1 events
debug: Finishing transaction -611081248
debug: Storing state
debug: Stored state in 0.01 seconds
</pre>
Nigel, what's the call on this? A good thing to have, but the way to do it and
across multiple service providers... bug or feature too?
----------------------------------------
Bug #7165: services restarted unnecessarily
https://projects.puppetlabs.com/issues/7165
Author: John Florian
Status: Needs Decision
Priority: Normal
Assignee: Nigel Kersten
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.