Closed xTrayambak closed 1 year ago
It seems fully eliminating libferuscli is a bad idea, instead, the child init process should go like this:
broker.createProcess() -> execCmd("./libferuscli
fork() is a bad idea, I tested it and seems to not work as everything starts running in a different process, as expected. For now, osproc.execCmd() is run in a different thread. Everything now works and this is no longer an issue.
Also, the fork() idea isn't fully discarded in the first comment, it is still available via a compiler flag but it won't work as it is my least priority.
It should now use fork(1) instead of what it does right now, as forking is less error prone, and it spawns the process as a child. Only a few changes are to be made: [ ] libferuscli should call os.fork() at initialization, and should kill itself if the fork syscall fails. [ ] The broker now just needs to import libferuscli and execute a function in it. [ ] To be less misleading, libferuscli should be renamed to ferus-child and no longer needs a separate binary.