Failed bench setup supervisor

Hello Everyone,
I am facing error when running : bench setup supervisor as shown below.
any suggestion what’s going wrong with my configuration?

cc: @rmeyer
Thanks in advances,
Ade Suhada


frappe@75f8aa7eb63e:/workspace/development/frappe-bench$ bench setup supervisor                
/etc/supervisor/supervisord.conf will be updated with the following values:

Updated supervisord.conf: 'chmod' changed from '0700                       ; sockef file mode (default 0700)' to '0760'
Updated supervisord.conf: 'chown' changed from '' to 'frappe:frappe'
Do you want to continue? [y/N]: y
$ sudo service supervisor reload
Usage: /etc/init.d/supervisord {start|stop|restart|force-reload|status}
Traceback (most recent call last):
  File "/home/frappe/.local/bin/bench", line 33, in <module>
    sys.exit(load_entry_point('frappe-bench', 'console_scripts', 'bench')())
  File "/home/frappe/.bench/bench/", line 117, in cli
    raise e
  File "/home/frappe/.bench/bench/", line 107, in cli
  File "/home/frappe/.local/lib/python3.9/site-packages/click/", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "/home/frappe/.local/lib/python3.9/site-packages/click/", line 1053, in main
    rv = self.invoke(ctx)
  File "/home/frappe/.local/lib/python3.9/site-packages/click/", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/.local/lib/python3.9/site-packages/click/", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/frappe/.local/lib/python3.9/site-packages/click/", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/frappe/.local/lib/python3.9/site-packages/click/", line 754, in invoke
    return __callback(*args, **kwargs)
  File "/home/frappe/.bench/bench/commands/", line 46, in setup_supervisor
    update_supervisord_config(user=user, yes=yes)
  File "/home/frappe/.bench/bench/config/", line 126, in update_supervisord_config
    service('supervisor', 'reload')
  File "/home/frappe/.bench/bench/config/", line 105, in service
    exec_cmd(f"sudo service {service_name} {service_option}")
  File "/home/frappe/.bench/bench/utils/", line 126, in exec_cmd
    raise CommandFailedError

This suggests you’re in frappe_docker development environment. There is no supervisor here.

There is sudo available in container allowing you to install anything with root privileges.

If wish to use supervisor, use easy_install or manual install.

Thanks for answering,
unfortunately i have already installed the supervisor, but the error message still the same.
is there any suggestion to change from development environment to production which is available to setup supervisor ?

Thanks you …

Searching for supervisor
Best match: supervisor 4.2.2
Processing supervisor-4.2.2-py2.py3-none-any.whl
Installing supervisor-4.2.2-py2.py3-none-any.whl to /home/frappe/.pyenv/versions/3.7.12/lib/python3.7/site-packages
Adding supervisor 4.2.2 to easy-install.pth file
Installing echo_supervisord_conf script to /home/frappe/.pyenv/versions/3.7.12/bin
Installing pidproxy script to /home/frappe/.pyenv/versions/3.7.12/bin
Installing supervisorctl script to /home/frappe/.pyenv/versions/3.7.12/bin
Installing supervisord script to /home/frappe/.pyenv/versions/3.7.12/bin

Installed /home/frappe/.pyenv/versions/3.7.12/lib/python3.7/site-packages/supervisor-4.2.2-py3.7.egg
Processing dependencies for supervisor
Finished processing dependencies for supervisor