DarthSim / overmind

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

Check if $PORT is available before passing it to process #82

Closed kalekseev closed 4 years ago

kalekseev commented 4 years ago

Overmind should pass only available port numbers otherwise the user experience is bad, if port is in use by some proc then try next (up to 3-5 tries).

DarthSim commented 4 years ago

I don't think this is good to dynamically select ports. I think things should be predictable. If a user starts his Procfile, and his Rails app is bint to port 5000, it should always be bint to 5000. Otherwise, it will confuse and frustrate the user.

kalekseev commented 4 years ago

Sure the decision is up to you, I prefer to have app started rather than interrupted by the fact that the port is allocated by someone, the idea to search for a port was taken from https://pypi.org/project/honcho/ - python implementation of the foreman.

Nebucatnetzer commented 1 year ago

How is this supposed to be working? I tried it with the following snipped but when I tried to start the second database in another directory it complained that the port 5000 was already used. I would like the user to be able to start as many instances as he wants in parallel.

db: postgres -p $PORT
DarthSim commented 1 year ago

@Nebucatnetzer You can configure the way Overmind sets the PORT variable: https://github.com/DarthSim/overmind#specifying-the-ports

Nebucatnetzer commented 1 year ago

I’ve seen that. So overmind doesn’t check if the port is available globally on the system?