A
A
alex--n2019-01-28 13:10:48
ruby
alex--n, 2019-01-28 13:10:48

How to run puma via supervisor?

Good afternoon!
Installed supervisor on ubuntu 16.04. In /etc/supervisor/conf.d created app.conf, in it

[program:app]
directory=/root/app
command=sh -c 'puma restart'
autostart=true
autorestart=true
stderr_logfile=/var/log/supervisor/app/err.log
stdout_logfile=/var/log/supervisor/app/out.log

If you execute puma restart directly in / root / app
Then everything starts. But when rebooting, the following entries appear in the log:
sh: 1: puma: not found
sh: 1: puma: not found
sh: 1: puma: not found
sh: 1: puma: not found
pumactl restart in the same way, it works in the folder, and nothing in the supervisor.
In ruby, a beginner at all, how to start it correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Boris Syomov, 2019-01-28
@kotomyava

You need to write the full path to puma in command, since you run it like that, and why run it through sh at all - should this be an executable file anyway?
PS And why do you need a supervisor at all, when you already have systemd in the system, which can do the same, and is configured almost the same way?
PPS Don't run anything as root unless it's really necessary. And of course, do not work under it all the time.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question