Ubuntu安裝和使用supervisor

2021-09-12 19:53:22 字數 1506 閱讀 5294

前言

對於需要以程序的方式常駐在ubuntu系統中或開機啟動的指令碼程式,通常使用supervisor程序管理工具進行管理。本文將簡單介紹supervisor程序管理工具的安裝和使用。

安裝

sudo apt-get install supervisor
新建程序配置

安裝supervsor程序管理工具後,建議在/etc/supervisor/conf.d/資料夾中為每乙個程序建立乙個程序配置。

cd /etc/supervisor/conf.d/

sudo touch test.conf

配置詳解

[program:test]

command=sh /usr/local/bin/test.sh ;被監控的程序路徑

numprocs=1 ; 啟動乙個程序

directory=/usr/local/bin/ ;執行前切換路徑

autostart=true ; 隨著supervisord的啟動而啟動

autorestart=true ; 自動重啟

startretries=10 ; 啟動失敗時的最多重試次數

exitcodes=0 ; 正常退出**

stopsignal=kill ; 用來殺死程序的訊號

stopwaitsecs=10 ; 傳送sigkill前的等待時間

redirect_stderr=true ; 重定向stderr到stdout

stdout_logfile=logfile ; 指定日誌檔案

啟動程序

supervisorctl reload

supervisorctl start test

命令詳解

#啟動程序

supervisorctl start ***

#重啟程序

supervisorctl restart ***

#重啟所有屬於名為group的分組程序

supervisorctl stop group

#停止全部程序

supervisorctl stop all

#載入最新配置的檔案

supervisorctl reload

#根據最新的配置檔案,啟動新配置或有改動的程序

supervisorctl update

Ubuntu安裝和使用Vivado

目錄 一 安裝ncurses庫 二 安裝 ivado 三 安裝驅動 四 重啟電腦 五 啟動vivado 六 常用tlc命令 sudo apt install libncurses5sudo xsetup在安裝目錄 tools xilinx vivado 2018.3 data xicom cable...

ubuntu下tftp安裝和使用

這樣tftp伺服器就啟動了,下面可以做乙個測試 4.cd tftpboot touch test 建立乙個檔案 5.cd home usrname 登入另乙個目錄 6.tftp 192.168.0.59 換成自己的ip get tftpboot test 如果能夠得到檔案,那麼就成功了。ps 不要忘...

ubuntu下ctags安裝和使用

一.安裝 sudo apt get install ctags 二.建立tags索引檔案 cd 目錄 ctags r 指令執行完後出現tags檔案 三.etc vim vimrc檔案底部增加 set tags tags 四.使用方法 1.vim t 開啟定義 的檔案,命令列模式 2.ts 命令就能列...