I have an app that I run as a Windows service using Srvany.exe as described in the application developers guide. On Linux it runs as a daemon and is controlled by the appropriate init.d scripts. On linux, I can register with the object engine to receive the sigterm signals and shutdown the app cleanly when daemon is stopped with the following code:
OSHandle currentOS == #unix
ifTrue:
[sem := Semaphore new.
ObjectMemory registerObject: sem withEngineFor: 'SIGTERM'.
[sem wait.
ObjectMemory quit] forkAt: Processor userInterruptPriority].
Doing this allows the Subsystem framework to work correctly and the tearDown actions are all performed.
Does anyone know how I can do a similar thing when running the app as a Windows service. The behavior currently is that when the service is stopped, the app is just killed, and no code can be run prior to shutting down.
Thanks,
Mike
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc