go-daemon icon indicating copy to clipboard operation
go-daemon copied to clipboard

allow a way for the child to communicate with the parent

Open kahing opened this issue 8 years ago • 5 comments

and vice versa. Possibly by just using a pipe?

kahing avatar Feb 17 '17 04:02 kahing

looks like there's already a pipe but it's closed before control is returned to the application. Possibly just need an option to not close the pipe

kahing avatar Feb 17 '17 05:02 kahing

@kahing Thank you for the request. Please explain what scenario do you want to implement? It is possible to extend Context with a binary data which will be transferred to the child on the start. The library use a unnamed pipe to transfer context to the child but there is no a way to use the pipe after terminating of the parent's process because the pipe is closed automatically by OS (on parent's side). If you want sometimes to connect to the child and send complex commands, we can use Named Pipe, i think. For simple commands is better to use System Signals.

sevlyar avatar Feb 17 '17 13:02 sevlyar

The use case is the parent want to wait for the child to potentially show errors to the user. I currently use signals as you can see in https://github.com/kahing/goofys/commit/eb7963e9fb33235d5650ee0f634902cffdded573 . However things like error messages are lost. I could use the logfile mechanism but that seems kind of overkill for just one error message.

kahing avatar Feb 17 '17 19:02 kahing

Ok, i think i understood you. I have an idea how to implement it.

sevlyar avatar Feb 20 '17 10:02 sevlyar

Would like to know how this issue is going... A pipe is also a good solution, if not the best, when the parent process wants to pass some credentials to its child.

Cnly avatar Aug 14 '18 08:08 Cnly