Issue #19808 has been updated by Klavs Klavsen.

I dug in and found that you use FileTest.exist to check if a file exists. If I 
just give that net.exe (which is what it seems you do) - it returns false.

If I give it c:\windows\system32\net.exe it returns true.

I looked at the ruby definition for FileTest.exist - which uses rb_stat- it 
does not seem as if it uses a Path variable..
and since Puppet::Util.which can find it (it uses the Path variable to search)) 
- it would seem the check that checks for existense of net.exe - should be 
using something like
 which(value) : FileTest.exist?(Puppet::Util.which(value))

Problem is your which provider gets the WRONG path..

I added the call to Puppet::Util.which at 
https://github.com/puppetlabs/puppet/blob/master/lib/puppet/provider/confine/exists.rb#L9
 

And in which command I echo path that it gets from ENV['PATH'] - it says the 
path is: /bin:/sbin:/usr/bin:/usr/sbin

which is obviously wrong on windows.

So somehow - the wrong path gets set. Any ideas as to where to look for that?

----------------------------------------
Bug #19808: Service provider for windows 2003 - does not work
https://projects.puppetlabs.com/issues/19808#change-87586

* Author: Klavs Klavsen
* Status: Needs More Information
* Priority: Normal
* Assignee: 
* Category: 
* Target version: 
* Affected Puppet version: 
* Keywords: 
* Branch: 
----------------------------------------
If I define:
service { 'nscp': ensure => running, enable => true }

puppet wants to use init provider.

I then tried to force it to use windows provider - but it fails (according to 
--debug) with "file net.exe does not exist" windows service provider is not 
functional on this host.

Yet: net nscp restart works just fine (ie. net works fine :)

Anything I can do to help debug?

I'm running puppet-3.1.1


-- 
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to