Issue #13489 has been updated by mello mollo.

Josh Cooper wrote:
> Thanks, yes, this is broken, both for autostart and manual services:
> 
> [...]
> 
> Output:
> 
> [...]

Hi, i have made some more test:

i have modified the following file /lib/puppet/provider/service/windows.rb
line 87:
<pre>
  def restart
    self.stop
    sleep 0.1 while Win32::Service.status(@service_name).current_state != 
'stopped'    #line added
    self.start
  end
</pre>

now work without problems.

First i tried using the "integrated" status definition:
<pre>
  def restart
    self.stop
    sleep 0.1 while self.status != :stopped             #line added
    self.start
  end
</pre>

but it doesn't work.

So i think the problem is somewhere in the following lines 96-97:
<pre>
      when "stopped", "pause pending", "stop pending", "paused" then :stopped
      when "running", "continue pending", "start pending"       then :running
</pre>

Hope that help to solve the problem.

Bye Mello.





----------------------------------------
Bug #13489: Service refresh on windows [version 2.7.12] triggered from 
(chaining|subscribe|notify) dosn't work and gives error.
https://projects.puppetlabs.com/issues/13489#change-58971

Author: mello mollo
Status: Accepted
Priority: Normal
Assignee: Josh Cooper
Category: windows
Target version: 2.7.x
Affected Puppet version: 2.7.12
Keywords: windows service
Branch: 


Hi, i have the following simple site.pp on the linux server [2.7.12] (to test 
puppet on windows client [2.7.12]):
<pre>
node 'prova' {
  service { 'NetTimeSvc':
     ensure => 'running',
  }

  exec { 'nettime_run_reg':
        command => "c:/windows/regedit.exe /s c:/prova/NetTime.reg",
  }
  
  Exec['nettime_run_reg'] ~> Service['NetTimeSvc']
}
</pre>

On windows client the following message appear when i run "puppet agent --test 
--verbose":

(Note: the service "NetTimeSvc" is already running)

<pre>
notice: /Stage[main]//Node[##########]/Exec[nettime_run_reg]/returns:
executed successfully
info: /Stage[main]//Node[##########]/Exec[nettime_run_reg]: Scheduling
 refresh of Service[NetTimeSvc]
err: /Stage[main]//Node[##########]/Service[NetTimeSvc]: Failed to call
refresh: Cannot start NetTimeSvc, error was: An instance of the service is 
already running.
notice: Finished catalog run in 1.68 seconds
</pre>

After this the service "NetTimeSvc" is in state stopped!

If the service was already stopped before running puppet the last error line is 
replaced with the following:
<pre>
notice: /Stage[main]//Node[##########]/Service[NetTimeSvc]/ensure: ensure 
changed 'stopped' to 'running'
err: /Stage[main]//Node[##########]/Service[NetTimeSvc]: Failed to call
refresh: Cannot stop NetTimeSvc, error was: The requested control is not valid 
for this service.
</pre>

After this the service "NetTimeSvc" is in state running!


I tried adding "hasrestart" and "hasstatus" (both with true or false value) to 
the service definition, but seems that, for windows client, puppet ignore them!
I even tried to work with a service integrated in windows (as the Spooler) but 
it gives me the same error messages.

Can you please confirm me if the problem does "really" exists or i am the only 
one to experience it?


Bye, Mello.


-- 
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.

Reply via email to