ccoverstreet / Jablko

Smart Home Interface powered by Go.
MIT License
1 stars 0 forks source link

Ensuring JMODs and children are killed correctly #91

Open ccoverstreet opened 3 years ago

ccoverstreet commented 3 years ago

The goal of recent development on the jabko-micro branch is to transition JMODs to use makefiles instead of separate bash scripts to build and start each mod. Part of this change is the need for pgids to be set for each JMOD and killing the resulting process group when needed. An issue with creating new process groups is that Jablko must explicitly kill the JMOD. This can be an issue if the Jablko process itself is terminated.

An interrupt signal handler was added in main.go that calls ModManager.CleanProcesses(), which attempts to kill all JMODs. This solution is fine for now, but more work is needed to ensure that JMOD processes do not become zombies.

Proposed solution:

ccoverstreet commented 3 years ago

It seems like PGIDs will be needed for managing processes.