1、安装supervisor

    1. yum -y install supervisor

    2、添加服务配置文件

    [program:Fastel.InvoiceService]  ##Fastel.InvoiceService是服务名称
    command=dotnet Fastel.InvoiceService.dll --ENVIRONMENT Release  ##启动服务需要执行的命令
    directory=/opt/Apps/Fastel.InvoiceService/latest/packages  ##在哪个目录下执行启动服务的命令
    
    user=user1 ##以user1用户启动Fastel.InvoiceService服务
    stdout_logfile=/opt/Apps/Fastel.InvoiceService/logs/stdout.log  ##标准输出日志路径
    stderr_logfile=/opt/Apps/Fastel.InvoiceService/logs/err.log     ##错误日志路径
    autostart=true       ##改服务随supervisor服务启动而启动
    autorestart=true     ##服务stop后自动重启
    

    3、命令管理
    启动**supervisor服务:supervisord -c /etc/supervisord.conf
    重载supervisor服务:supervisorctl reload
    重启supervisor下的所有服务:supervisorctl restart all
    重启supervisor下的指定服务: supervisorctl restart service_name

    **