【问题标题】:How to start a process in PM2 with custom command如何使用自定义命令在 PM2 中启动进程
【发布时间】:2020-09-07 15:00:16
【问题描述】:

我需要运行这个命令才能让我的 python 脚本工作。

$ xvfb-run python3 test.py

我怎样才能通过PM2 start实现这一目标?

【问题讨论】:

    标签: linux ubuntu command pm2


    【解决方案1】:

    找到了解决办法。

    我创建了一个 [FILENAME].sh 文件,其中包含以下内容:

    #!/bin/bash
    cd /path/to/project
    xvfb-run python3 test.py
    

    并使用 PM2 执行:

    pm2 start [FILENAME].sh
    

    【讨论】:

      猜你喜欢
      • 2015-12-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-02-17
      • 2014-04-07
      • 1970-01-01
      • 2015-02-17
      相关资源
      最近更新 更多