ติดตั้ง Supervisor บน Debian 10
1 min read

ติดตั้ง Supervisor บน Debian 10

1) ติดตั้ง supervisor

apt-get update
apt-get install supervisor

สั่ง systemctl restart supervisor.service เพื่อให้ supervisor ทำงาน

สั่ง systemctl status supervisor.service ดู status supervisor

2) เพิ่มโปรแกรมให้รันด้วย supervisor

ไปที่ /etc/supervisor/conf.d/

เพิ่มไฟล์ config

vim program.conf

ตัวอย่าง config supervisor

[program:name-program]
command= command run program
autostart=true
autorestart=true
stderr_logfile=/var/log/name_program.err.log
stdout_logfile=/var/log/name_program.out.log

สั่ง run โปรแกรมผ่าน supervisor ครั้งแรก

supervisorctl reread
supervisorctl update

แสดงโปรแกรมทั้งหมดที่รัน

supervisorctl

สั่ง restart หรือ stop โปรแกรมใน supervisor

สั่ง stop
supervisorctl stop name-program

สั่ง start
supervisorctl start name-program

สั่ง restart
supervisorctl restart name-program

Ref

How To Install and Manage Supervisor on Ubuntu and Debian VPS | DigitalOcean
Here’s our tutorial on installing and managing Supervisor on Ubuntu and Debian.