i have started the bench using “bench start” , however to stop the bench i should press “ctrl + c”. but instead of pressing “ctrl + c”. i closed the ssh session, now the website is always running. how can i stop the bench ??
I asked myself the same question before. As far as I know there is only bench start and bench restart, so just pure logic there is a bench stop command that’s missing (or probably there must be another method for stopping it).
kill -SIGTERM PID but may be it will leave a zombie. If you looking for something like bench stop you are lose your time because bench in developer mode “runs” in the current ssh session and if lose the connexion the process hangs better know as zombie process.
@gvargas I am not talking about a particular scenario (accessing my server through ssh, or so) more generally interested in how to stop the bench gracefully. I guess it’s not the most like thing that the developers of bench just forgot to have a command for stopping it?
And as we are at it I think it would be great to have the ability to see that status of it (runing, stopped, which sites are running on which ports, …)
something like bench status (which apparently doesn’t exist)
This actually has the exact same implications (ERPnext being served under port 80) as if there was not entry about the nginx port in the site_config.json file at all (because port 80 is the standard port), right?
Apologies for necroing a 3-year old post. However, it’s still quite relevant. For those catching up, the original question was “We can start bench, and restart bench…how can we stop it?”
First, a short demonstration of why “CTRL + C” won’t always work. In your bash shell, simply do this:
bench start $
Now, bench is running in the background.
Yes, I know you can return this to the foreground, using fg.
Yes, I know you can hunt for processes using ps aux | grep bench, and a dozen different variations.
Yes, I know this issue doesn’t happen in Production.
With all that said…it’s still a pain.
Folks, we have at least 50 different bench commands. How about we add just 1 more, to automatically kill Bench/Frappe/ERPNext. No matter whether it’s running in the foreground, background, underground, or coffee ground.
I’ll give you a few days to convince me that I’m asking for crazy things. Otherwise, I’ll open an Issue in GitHub against Bench.