Supervisor vs systemd

What is the benefits of using the default supervisor vs configuring bench for systemd via:

bench setup systemd

if you prefer systemd instead of supervisor then use it.

everywhere in community and docs supervisor is used.

My question was why frappe would add an extra dependency to use supervisor when it could simply use built-in systemd ?
Is there anything supervisor does that is not provided by systemd? Or is it frappe wanted to be agnostic of systemd?

supervisor is the default process manager since beginning. systemd was added later. Everywhere you’ll find supervisor is used because it was there since beginning.

2020 onwards I’m not using supervisor or systemd. I’m using containerized setup for development as well as production.

1 Like

so, how to use systemd instead of supervisor?

bench setup systemd

then what next?

To accomplish that, you must create and manage Systemd Unit Files. At the minimum, you’ll need 1 per component of ERPNext that must start automatically:

  • Gunicorn Web Server
  • 3 Redis databases
  • Scheduler
  • Background Workers
  • NodeJS Socket service

Here are a few articles about Systemd’s Units:

Below is an example I’m personally using, which demonstrates how to start the gunicorn web server.

You cannot just copy & paste it: your own Unit File will need different values. But hopefully this gives you an idea. You can compare this to the data in 'frappe-bench/Procfile'

Description="Frappe HTTP Web Server"

ExecStart=/erpnext/mybench/env/bin/gunicorn -b -w 9 -t 120 --preload


Thank you Brian, I found a simple solution for this.

bench setup systemd
sudo cp config/systemd/* /usr/lib/systemd/system/
sudo systemctl enable #use your init folder in my example using "frappe-bench"
sudo systemctl start

Does it bring anything new to the table?

The production setup page is updated and it advices to use containerized setup.

I am not sure why it is recommended way?

1 Like