Replies: 8 comments
-
I actually think that it's some interaction with |
Beta Was this translation helpful? Give feedback.
-
Likely yes, remember that the child is a completely new process and tokio might not play well with that. |
Beta Was this translation helpful? Give feedback.
-
Try creating a simple POC to test the hypothesis I don't have a mac on hand right now where I could do a test to confirm, I might do a quick test on linux see what happens, but my guess it's tokio being unhappy about being forked |
Beta Was this translation helpful? Give feedback.
-
Actually tokio-rs/tokio#4301 this would point to that |
Beta Was this translation helpful? Give feedback.
-
Thanks @neonimp – I'll close this issue for now and do some additional testing. If we come up with some solution, maybe we can add it to the examples :) |
Beta Was this translation helpful? Give feedback.
-
Not sure if tokio has something for this to work, but I would try to do the forking and then use one of the hooks provided by the lib to start tokio after the fork @wolfv |
Beta Was this translation helpful? Give feedback.
-
Yes, do a non tokio main that sets up the code and calls the demonization code, https://docs.rs/tokio/latest/tokio/runtime/index.html#usage then with a child hook and a parent hook start tokio and do whatever you may need to do. |
Beta Was this translation helpful? Give feedback.
-
Did you get a chance to test that theory @wolfv I will add it to the docs after some testing of my own otherwise |
Beta Was this translation helpful? Give feedback.
-
Hi, thanks for the awesome crate – it's very useful.
I am trying to daemonize a process, but after daemonizing it I still need to start a
Command
(sub-process). Somehow the child just seems to abort.Do you happen to know if this is a known issue? Do I need to set some permissions correctly? This is on macOS and I haven't tried Linux yet.
Cheers!
Beta Was this translation helpful? Give feedback.
All reactions