Skip to content
A Ruby library that allows users to inspect, control or create services on MS Windows
Branch: master
Clone or download
chef-ci Update CHANGELOG.md to reflect the promotion of 2.1.4
Obvious fix; these changes are the result of automation not creative thinking.
Latest commit ba3c837 Apr 18, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.expeditor
.github Merge ffi branch back into master Dec 31, 2018
doc Merge ffi branch back into master Dec 31, 2018
examples Merge ffi branch back into master Dec 31, 2018
lib Bump version to 2.1.4 by Chef Expeditor Apr 17, 2019
spec/unit/win32 Bugfix: NoMethodError in Win32::Service.new Apr 17, 2019
tasks Add rspec unit tests Mar 11, 2019
test Add ::close_service_handle method Mar 11, 2019
.gitignore Merge ffi branch back into master Dec 31, 2018
.rspec
CHANGELOG.md
CODE_OF_CONDUCT.md Merge ffi branch back into master Dec 31, 2018
Gemfile Add a test group for chefstyle in the gemfile Mar 11, 2019
README.md Add the appveyor badge to the readme Mar 11, 2019
Rakefile Add rspec unit tests Mar 11, 2019
VERSION Bump version to 2.1.4 by Chef Expeditor Apr 17, 2019
appveyor.yml Require and test on Ruby 2.3+ Mar 11, 2019
win32-service.gemspec Require and test on Ruby 2.3+ Mar 11, 2019

README.md

win32-service

Build status Gem Version

The win32-service library allows you to control or create MS Windows services.

Installation

gem install win32-service

Usage

require 'win32/service'

# Iterate over the available services
Win32::Service.services do |service|
  p service
end

More Documentation

Please see the documentation in the 'doc' directory, or the gem documentation that was installed when you installed this library as a gem.

Known Issues

Problem:

Service.delete causes "Unable to delete: The specified service has been marked for deletion."

Troubleshooting:

This can be caused by one of two things. Either you attempted to delete a running service without stopping it first, or you have the Services Administrative Tool (GUI) open. In the former case, the solution is to first stop the service if it's running. In the latter, close the Services GUI admin tool before deleting.

Problem:

Service.start causes, "The service did not respond to the start or control request in a timely fashion."

Troubleshooting:

The best way to debug your services is to wrap your entire Daemon subclass in a begin/end block and send error messages to a file. That should give a good clue as to the nature of the problem. The most probable culprits are:

  • You forgot to require 'win32/daemon' in your Daemon code.

  • You've tried to require a library that's not in your $LOAD_PATH. Make sure that your require statements are inside the begin/rescue block so that you can easily find those mistakes.

  • Your have a bad binary path name. Be sure to use an absolute path name for the binary path name, including the full path to the Ruby interpreter, e.g. 'c:\ruby\bin\ruby' instead of just 'ruby'.

  • You've got a syntax error in your code somewhere.

See Also

ruby-wmi

Future Plans

Add service_session_change hook

Copyright

(C) 2003-2018, Daniel J. Berger, All Rights Reserved

License

Artistic 2.0

Warranty

This package is provided "as is" and without any express or implied warranties, including, without limitation, the implied warranties of merchantability and fitness for a particular purpose.

Authors

  • Daniel J. Berger
  • Park Heesob
You can’t perform that action at this time.