[Win32utils-devel] Fwd: Problem with starting service with win32-service

Daniel Berger djberg96 at gmail.com
Thu Jul 25 14:33:08 UTC 2013

---------- Forwarded message ----------
From: Sean Karlage <sean.karlage at uky.edu>
Date: Mon, Jul 22, 2013 at 11:29 AM
Subject: Problem with starting service with win32-service
To: win32utils-devel at rubyforge.org

Hi all,

At Daniel's request, I'm posting my problem to this mailing list in the
hope that it can be resolved.

I'm using Windows 7 x64 in a virtual machine with an OS X 10.8.4 host, and
I'm using win32-service 0.8.0 (obtained via a gem install). Ruby version is
ruby 2.0.0p195 [x64-mingw32].

This service monitors a directory (and all files and subdirectories under
it) and notifies owners of those files at the emails in a file of
corresponding emails to usernames when they haven't been modified/touched
in some configurable amount of days. After some other (longer) number of
days, the files are purged.

I can install my service just fine, and it is picked up when I do a
Service.status() on it. However, when I go to actually start the service I
immediately get 'The service did not respond to the start or control request
in a timely fashion.' I followed Daniel's suggestion on his github page and
wrapped my service in a begin/end block, and ensured that the command
executable was correct, but control doesn't even seem to be getting to my
service code at all - control does not even enter service_main at all as
far as I can tell.

I've attached my code, as well as a sample configuration file. I'd
appreciate any help with this.

All three files should be in the same directory when they are run. It can
be executed as follows:

 ruby sharecleaner_daemon_controller.rb [-config C:/path/to/config/file]
[-emails C:/path/to/emails/file] install|start|uninstall|pause|resume


Sean Karlage
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/win32utils-devel/attachments/20130725/7f61b367/attachment-0001.html>
-------------- next part --------------
# Default email to send in case the username in the share is not known.
default_email = user at example.com

# How old of files to look for to delete (in days).
delete_duration = 5

# These next two allow you to alter the text of the email if you desire. The
# email is laid out as follows:
#   list of files
#email_header = "text"
#email_footer = "text"

# How old of files to look for in order to notify the owner it will be deleted
# (in days).
notify_duration = 3

# How long to wait while in the PAUSE state.
#pause_frequency = <days>

# The email address the script will send from.
#script_email = <address>

# List of absolute path names to share drives/folders. Each share is separated
# by a bar.
share_list = C:/path/to/share

# How often the script should run (in days).
update_frequency = 1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sharecleaner_daemon_controller.rb
Type: application/octet-stream
Size: 3355 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/win32utils-devel/attachments/20130725/7f61b367/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sharecleaner_daemon.rb
Type: application/octet-stream
Size: 7492 bytes
Desc: not available
URL: <http://rubyforge.org/pipermail/win32utils-devel/attachments/20130725/7f61b367/attachment-0003.obj>

More information about the win32utils-devel mailing list