Displaying 3 results from an estimated 3 matches for "errorstopservice".
2006 Dec 07
0
Fwd: win32-service problems with patch
...s was really necessary.
* raising exceptions in service_init and service_main left the service
running - required service_init and main to have rescue clauses to catch
all exceptions AND NOT EXIT so that the SCM could still send the stop
message, so that the threads would be cleaned up and etc.
* ErrorStopService removed because it was abused - called when it didn''t
make sense. Instead, I explicitly put in error handling and set
hStopEvent or set service status appropriately. Probably could still be
better.
* Waiting for hThread to exit AFTER closing hStopEvent (which might be
waiting on hStopEv...
2005 Nov 26
1
Another patch of win32-service for nice startup.
...reateThread(NULL,0,ThreadProc,0,0,&ThreadId);
- if(hThread == INVALID_HANDLE_VALUE){
+ // Create the event to signal the service to start.
+ hStartEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
+ if(hStartEvent == NULL){
strcpy(error,ErrorDescription(GetLastError()));
ErrorStopService();
rb_raise(cDaemonError,error);
@@ -257,11 +268,20 @@
rb_raise(cDaemonError,error);
}
- // Wait for SERVICE_RUNNING
- while(dwServiceState != SERVICE_RUNNING){
- sleep(10);
+ // Create Thread for service main
+ hThread = CreateThread(NULL,0,ThreadProc,0,0,&a...
2005 Sep 08
11
Stopping services
I''m back to getting stuff to run as a Windows service, and am running
in to a problem. My service (a Daemon ruby class) installs and starts
fine, but when I try to stop it, I get:
C:\workspaces\default\tahoe>ruby script\service stop
script/service:77:in `stop'': An exception occurred in the service
when handling
the control request. (Win32::ServiceError)
from