[Win32utils-devel] Some code change suggestions of thenwin32-service package
Berger, Daniel
Daniel.Berger at qwest.com
Wed Nov 23 09:42:34 EST 2005
> -----Original Message-----
> From: win32utils-devel-bounces at rubyforge.org
> [mailto:win32utils-devel-bounces at rubyforge.org] On Behalf Of
> Park Heesob
> Sent: Wednesday, November 23, 2005 6:16 AM
> To: Development and ideas for win32utils projects
> Subject: [Win32utils-devel] Some code change suggestions of
> thenwin32-service package
>
>
> Hi,
>
> I'd like to suggest some code modifications and tests.
>
> In service.c
> line # 50 : Commet out 1 line
> // SetTheServiceStatus(SERVICE_RUNNING, NO_ERROR, 0, 0);
>
> line # 260 : Insert 4 lines
> if(rb_respond_to(self,rb_intern("service_init"))){
> rb_funcall(self,rb_intern("service_init"),0);
> }
> SetTheServiceStatus(SERVICE_RUNNING, NO_ERROR, 0, 0);
>
> In Ruby source
> Insert 'service_init' method for initialization
>
> I tested with long initialization and it worked fine.
>
> def service_init
> for i in 1..10
> File.open("c:\\test2.log","a+"){ |f| f.puts("#{i}") }
> sleep 10
> end
> end
>
> I think it is not a perfect solution but at least better than
> the current
> verison.
>
> Regards,
>
> Park Heesob
This looks reasonable. Did we still want to use
SetTheServiceStatus(SERVICE_START_PENDING, NO_ERROR, checkpoint, 0)
somewhere during initialization, or does the creation of a service_init
method eliminate the need for it?
Thanks,
Dan
More information about the win32utils-devel
mailing list