Skip to content

Instantly share code, notes, and snippets.

@happymcplaksin
Created September 4, 2013 01:49
Show Gist options
  • Save happymcplaksin/6431886 to your computer and use it in GitHub Desktop.
Save happymcplaksin/6431886 to your computer and use it in GitHub Desktop.
Register the YaketyStats service on Windows
equire "win32/service"
include Win32
begin
Service.new(
:service_name => 'yaketystats',
:host => 'localhost',
:service_type => Service::WIN32_OWN_PROCESS,
:description => 'YaketyStats client for Windows',
:start_type => Service::AUTO_START,
:error_control => Service::ERROR_NORMAL,
:binary_path_name => 'c:\usr\local\ys\ruby\bin\ruby.exe C:\usr\local\ys\collector\bin\yaketystats-service > c:\var\yaketystats\service.log 2>&1',
:load_order_group => 'Network',
:dependencies => ['W32Time','Schedule'],
:service_start_name => 'LocalSystem',
:display_name => 'YaketyStats',
)
rescue => e
print "Badness trying to register service: #{e.inspect}.\n"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment