08 2021 档案
摘要:需求 需要开机运行项目,使用systemctl来控制gunicorn开机启动 systemctl配置文件 在/usr/lib/systemd/system/下增加文件project.service,文件名根据需要命名,以.service结尾,文件内容: [Unit] # 描述 Description
阅读全文
摘要:python使用subprocess执行shell脚本 项目中需要在后端执行shell脚本,使用subprocess库的Popen对象 参考官方文档 import subprocess def execute_command_with_no_out(cmd, timeout): """ 执行shel
阅读全文