rapiddisk icon indicating copy to clipboard operation
rapiddisk copied to clipboard

fix(daemon leaks): rework main loop and fork() approach

Open matteotenca opened this issue 2 years ago • 2 comments

fix(daemon leaks): rework main loop and fork() approach

Make the daemon fork() twice, remove the thread and use signals to clean-exit.

Why fork() twice: http://www.faqs.org/faqs/unix-faq/programmer/faq/ at 1.7. Redirect STD* to /dev/null in daemon mode.

Added the -d switch to avoid forking and printing messages to STDERR.

Let me know what you think @pkoutoupis !

Next step is to output JSON without invoking rapiddisk.

Regards

matteotenca avatar Sep 24 '22 01:09 matteotenca

Since both this and the other PRs are fairly large, I would like to schedule a Zoom call (if you do not mind) to step through them. Can you please reach out at petros AT petroskoutoupis DOT com?

pkoutoupis avatar Sep 26 '22 13:09 pkoutoupis

Since both this and the other PRs are fairly large, I would like to schedule a Zoom call (if you do not mind) to step through them. Can you please reach out at petros AT petroskoutoupis DOT com?

I'll write you ASAP!

Regards

matteotenca avatar Sep 27 '22 18:09 matteotenca

This PR is superseeded by #139, can be closed.

Regards

matteotenca avatar Nov 04 '22 21:11 matteotenca

Per the request.

pkoutoupis avatar Nov 05 '22 12:11 pkoutoupis