Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When run as service: Leaves ruby running and temp directory in place #15

Open
alfmar opened this issue Dec 23, 2010 · 2 comments
Open
Labels

Comments

@alfmar
Copy link

alfmar commented Dec 23, 2010

On Windows Server 2008, if the ocra-generated EXE file is started as a service using SRVANY.EXE, when the service is stopped/killed, the ruby.exe/rubyw.exe continues running.

Killing the ruby.exe/rubyw.exe does not automatically clear the temporary directory hierarchy.

Is this a SRVANY.EXE problem or an OCRA problem?

@larsch
Copy link
Owner

larsch commented Dec 23, 2010

Lets call it an OCRA deficiency. It can be handled by OCRA. I'll look into it.

@larsch
Copy link
Owner

larsch commented Jan 23, 2011

I appears that Windows provide no method to trap kill signals. I only know only one way:

  1. Implement a service stub as alternative to the default main stub, which is based on the Windows' service API. Then the executable can be registered as a service on its own and will be notified of stop requests.

It probably possible to make the default stub slightly more robust by creating a message-only window and handling the WM_CLOSE message. However, this will still not help when running from SRVANY.EXE, nor when being terminated from the Process Explorer. WM_CLOSE appears to be the "official" method for terminating a process while giving it a chance to clean up, even for applications without windows (except services of course).

@larsch larsch added the feature label Oct 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants