Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Would be useful to provide a "foreman stop" command #156

Closed
rtyler opened this issue Feb 22, 2012 · 8 comments
Closed

Would be useful to provide a "foreman stop" command #156

rtyler opened this issue Feb 22, 2012 · 8 comments

Comments

@rtyler
Copy link

rtyler commented Feb 22, 2012

In the case where you're in another terminal, or have backgrounded the foreman process with & (which I plan to do inside of a Jenkins job), it would be useful to have a foreman stop stop the process the same way that a Ctrl+C might work

@ddollar
Copy link
Owner

ddollar commented Jun 11, 2012

How would foreman stop know which foreman to stop?

If you have a good plan for this, I'd consider this pull request.

@ariofrio
Copy link

A somewhat related issue is #235.

@sethlivingston
Copy link

Possibly related to #384...

A foreman stop command would make it easier and more elegant to accomplish what I'm having to do now:

#!/bin/bash
foreman start &
python pnp_consumer/tests.py "http://localhost:5000/"
kill $!

The kill statement is a little hacky, plus it doesn't work: it kills the foreman process, but the gunicorn instances running (from my Procfile) remain running and tie up the port.

@ddollar ddollar closed this as completed Apr 23, 2014
@waxgenius
Copy link

Why was this closed?

@ddollar
Copy link
Owner

ddollar commented May 19, 2015

Foreman is designed to be run in the foreground. This feature would add a lot of complexity (how do we know which foreman to stop) for something outside the primary use case.

@sebs
Copy link

sebs commented Aug 2, 2017

I know it is a old one, but I have to clear some state after ^C occurs. Hence I googled this ticket. he state is a PID file that I need to get out of the way.

@axelkennedal
Copy link

axelkennedal commented Aug 19, 2017

Having the exact same problem as @sebs and would really like a fix for this. I'm using Foreman for the dev environment for a React + Electron desktop app (per the recommendation of this article) where I start a dev server at localhost:5000. When I hit ctrl-C Foreman quits, but it leaves the server running and still listening at :5000, meaning that when I attempt to start my Foreman service again it throws an error because there is already another process listening to :5000.

Is there a way to terminate all child processes from the interactive prompt?

@sebs
Copy link

sebs commented Aug 20, 2017

My Scenario: I start a docker environment with

forman start
.... executes docker-compose up --build 

I

I use STG+C and in one of 1000 cases, the docker magic fails. Let it be a filehandle open blocking a shutdown of your app or a db connection.

So I would love to have a stupid list of forman stop to clean all the state that I want to clean. Just in case. In my case, this would be a

docker-compose down

@axelkennedal make sure your dev server processes all the important events for exiting the shell. most dev servers are just dev servers. I would expect the server not to terminate because of open connections that still do io. Long running request etc come in mind. On one side this is: go fix electron and not foreman for a faulty implementation. On the other side, I would love to see the tool for these faulty scenarios in foreman. Hope all this makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants