1. 程式人生 > >ubuntu16.04中supervisor安裝與使用(轉載)

ubuntu16.04中supervisor安裝與使用(轉載)

cheng ubun shu 控制臺 super 占用 pre www. artisan

ubuntu16.04中supervisor安裝與使用

supervisor 進程管理是可以讓進程在後臺運行,而不占用控制臺影響使用

1. 安裝 supervisor

sudo apt install supervisor

2. 添加進程

supervisor 可以將每個進程分別寫成一個文件,supervisor 的進程文件放在 /etc/supervisor/conf.d/ 目錄下,本例創建 test.conf 進程配置文件。其中 program 為要運行的進程的名稱, command 為要執行的命令,directory 要執行命令的目錄,user 運行的用戶。

[program:test]
command=php artisan queue:work
directory=/var/www/html/wisdom
user=ubuntu

3. 啟動進程

首先要重啟supervisor,讓配置文件生效

supervisorctl reload

然後啟動進程

supervisorctl start test

完成。

本文轉自:https://www.jianshu.com/p/79a3d1000aa2
如需轉載,請註明出處:http://www.cnblogs.com/zhuchenglin/p/8366600.html

ubuntu16.04中supervisor安裝與使用(轉載)