ติดตั้ง Supervisor บน Debian 10
1) ติดตั้ง supervisor
apt-get update
apt-get install supervisor
![](https://blog.unixdev.co.th/content/images/2021/03/image-25.png)
สั่ง systemctl restart supervisor.service เพื่อให้ supervisor ทำงาน
![](https://blog.unixdev.co.th/content/images/2021/03/image-28.png)
สั่ง systemctl status supervisor.service ดู status supervisor
![](https://blog.unixdev.co.th/content/images/2021/03/image-29.png)
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
![](https://blog.unixdev.co.th/content/images/2021/03/image-31.png)
![](https://blog.unixdev.co.th/content/images/2021/03/image-30.png)
สั่ง 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
![](https://www.digitalocean.com/assets/community/illustrations/DigitalOcean_Community-e00e73a18df20667c3117725e727f3ade330204dff619ad8153050ded7341627.jpg)