Works for me since supervisor is only running frappe-bench
EDIT: Sorry I didn’t see where you stated you manually started bench. Can you SSH back in and reboot, or stop the nginx service? You could also use htop to stop individual processes.
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)
bench start method for starting bench is for setting up development environment. Kill it with CTRL+C.
For production deployment use nginx, supervisor
In production deployment where nginx and supervisor are up on boot. Use command bench doctor to check status of production deployed bench.
Configured ports:
For production setup where port based multi-tenent is configured, run command bench setup nginx
to generate frappe-bench/config/nginx.conf with configured ports.
Port for site is set in site_config.json of the site by running command bench set-nginx-port sitename 80
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?
My developmnet environment went background . how can I restart bench one shot? I’t s not comfrtable to kill one bye one all processes all the time a restart is required in the development environment
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.
@brian_pond - great initiative and @adam26d -the work you did is enabling users like me without any coding knowledge to reach for our dreams. Please keep up the great work