DarthSim / overmind

Process manager for Procfile-based applications and tmux
MIT License
2.84k stars 79 forks source link

Separate how signals work for stop vs. restart actions #71

Closed pnomolos closed 4 years ago

pnomolos commented 4 years ago

I have never written Go before, so what I've done may not be very idiomatic (pretty much copied the stop-signal related code), but hopefully it's still useful.

I'm curious what the thought would be on having a general overmind signal {process_name} [signal] command might be (rather than having to track PIDs down)?

DarthSim commented 4 years ago

Hi, Could you describe a case where this would be useful?

pnomolos commented 4 years ago

In my case because I’m using Puma and want to send USR2 for restart and INT to stop (https://github.com/puma/puma/blob/master/docs/signals.md)

DarthSim commented 4 years ago

In this case, the signal command would be more applicable. The restart command expects a process to exit, but USR2 doesn't stop Puma, so it will break restart behavior.

pnomolos commented 4 years ago

Hi @DarthSim, thanks, I guess that is what I’m looking for. A potential request, then, for the ability to add custom signal handlers - such as “overmind reload” - which you can customize the signals for (because Sidekiq takes a different signal than Puma does for a code reload). That being said, I could probably achieve that via clever use of shell aliases or functions rather than adding more code to Overmind :)

DarthSim commented 4 years ago

Ok, since we agree here, I'll close this PR. Feel free to open a new one with overmind signal command, this would be a great feature.