L
L
LionG2018-12-15 11:33:23
Node.js
LionG, 2018-12-15 11:33:23

How to configure supervisor so that it continues to work after the crash of the script and restarts it only when it changes?

supervisord.conf

[program:service]
command=/usr/bin/supervisor -w /home/liong/Desktop/web/NODE/service -i node_modules /home/liong/Desktop/web/NODE/service/server.js
stdout_logfile=/home/liong/Desktop/web/NODE/service/std.log
stderr_logfile=/home/liong/Desktop/web/NODE/service/std.log
autostart=true
autorestart=true
user=root
stopsignal=KILL
numprocs=1

Through ftps I edit files in sublime text, when changing files supervisor restarts server.js. The problem is that if you make any typo, for example, leading to a script crash, then the supervisor goes into a cycle of attempts to revive the process. How can I configure it so that it does not try to restart the script on error / completion, but at the same time continues to monitor changes in the folder and restart in case of changes in files?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
LionG, 2018-12-15
@LionG

-n|--no-restart-on error|exit|success
Don't automatically restart the supervised program if it ends.
Supervisor will wait for a change in the source files.
If "error", an exit code of 0 will still restart.
If "exit", no restart regardless of exit code.
If "success", no restart only if exit code is 0.
https://www.npmjs.com/package/supervisor

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question