DarthSim / hivemind

Process manager for Procfile-based applications
MIT License
1k stars 30 forks source link

hivemind fails to start some processes properly, but foreman works as expected #29

Closed todd-a-jacobs closed 1 month ago

todd-a-jacobs commented 2 years ago

Summary

The following Procfile works properly with foreman 0.87.2, but fails to execute both processes when called with hivemind 1.1.0 as installed via Homebrew. Go reports itself as go version go1.18.1 darwin/amd64.

Procfile

yard: open -a Safari.app http://localhost: 8088
coverage: open -a Safari.app coverage/index.html

Failures from Hivemind

With foreman start, a PID is created for each browser process, and the relevant pages are opened in Safari. However, with hivemind ./Procfile the first process starts correctly even though hivemind thinks it has immediately exited. The second process (coverage) never runs, and reports:

coverage: Running
yard: Running...
yard: Process exited
coverage: Interrupting...
coverage: Signal: interrupt

This intuitively seems to be an issue with jobs that fork or share a parent process, since in actuality the YARD server (started separately by Guard in this case) continues to run, but hivemind seems to think that because open has exited it should not start or continue the other defined processes defined in the Procfile.

If there's a work-around, or if I've misunderstood the documentation, please let me know. Otherwise, this seems like a bug for anything that might spawn background processes or have non-interdependent processes that should not fail to start or continue to run simply because another named process within the Procfile did.

asmrtfm commented 1 month ago

My issue feels tangentially related so here's what I've got:

I was using foreman. It is still installed. (should I have removed it first?)

Procfile:

web: bin/rails server
css: bin/rails tailwindcss:watch

❱ gem install hivemind

Successfully installed hivemind-0.1 Parsing documentation for hivemind-0.1 Done installing documentation for hivemind after 0 seconds 1 gem installed

( I also added it to the development, test group in my Gemfile, and ran bundle install - no errors, no impact on the following outputs )

❱ hivemind

hivemind runs the file hivemind render renders the source with

❱ hivemind Procfile

file doesn't specify a syntax

( the README does not mention anything about syntax )

( I'm on ubuntu-22.04 running ruby 3.2.4 via asdf )

DarthSim commented 1 month ago

@todd-a-jacobs I doubt that this issue is actual after 2 years, but you can use the -W flag of open. This flag makes open wait until the requested application is closed.

@asmrtfm Hivemind doesn't have a Ruby gem. What you actually installed with gem install hivemind is https://github.com/alehander92/hivemind