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

The daemon created by the client should survive if the client is interrupted using Ctrl+C #193

Closed
gnodet opened this issue Nov 9, 2020 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@gnodet
Copy link
Contributor

gnodet commented Nov 9, 2020

The JVM has a bad habit (for our use case) to still own child processes.
This means that when the JVM receives an interrupt signal, it will forward it to child processes.
The means that if the client creates a daemon receives a SIGINT, the daemon won't be able to survive.
The daemon needs to call setsid in order to detach. The jansi library would be a good candidate for this function since it already contains a bunch of posix functions.

@gnodet gnodet added the enhancement New feature or request label Nov 9, 2020
@ppalaga
Copy link
Contributor

ppalaga commented Nov 11, 2020

Is this the case only when the daemon is started from mvnd.sh - i.e. from a stock JVM? I am asking because the daemon seems to survive when I interrupt the mvnd native client with CTRL+C.

@ppalaga
Copy link
Contributor

ppalaga commented Nov 11, 2020

the daemon seems to survive when I interrupt the mvnd native client with CTRL+C.

Plz. forget what I said. The daemon is killed indeed.

@gnodet
Copy link
Contributor Author

gnodet commented Nov 12, 2020

Actually, a more simple way may be to simply have the daemon ignore the INT and TSTP signals, it would avoid any additional JNI requirement.

gnodet added a commit to gnodet/mvnd that referenced this issue Nov 13, 2020
@gnodet gnodet changed the title When spawning a daemon, the daemon should somehow call setsid The daemon created by the client should survive if the client is interrupted using Ctrl+C Nov 13, 2020
@gnodet gnodet closed this as completed in d02518e Nov 13, 2020
@ppalaga ppalaga added this to the 0.0.13 milestone Nov 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants