【问题标题】:Forever tool with mosquitto mqtt带蚊子 mqtt 的永远工具
【发布时间】:2020-09-26 18:50:11
【问题描述】:

我正在尝试使我的 mosquitto mqtt 代理在我的云实例上不断运行,使用永远的工具,使用 forever start -l mqtt.log --append -c -sh /root/mqtt-sh.sh,我已经通过将 #!/bin/sh /usr/sbin/mosquitto -c /etc/mosquitto/conf.d/broker.conf 添加到 mqtt-sh.sh conf 文件中创建了 shell 脚本。 但这是我得到的输出:

help:    usage: forever [action] [options] SCRIPT [script-options]
help:
help:    Monitors the script specified in the current process or as a daemon
help:
help:    actions:
help:      start               Start SCRIPT as a daemon
help:      stop                Stop the daemon SCRIPT by Id|Uid|Pid|Index|Script
help:      stopall             Stop all running forever scripts
help:      restart             Restart the daemon SCRIPT
help:      restartall          Restart all running forever scripts
help:      list                List all running forever scripts
help:      config              Lists all forever user configuration
help:      set <key> <val>     Sets the specified forever config <key>

我还检查了 forever list 中的进程,但它不存在

【问题讨论】:

    标签: shell ubuntu mosquitto forever


    【解决方案1】:

    Forever 用于运行 NodeJS 脚本文件,而不是 shell 脚本。

    mosquitto 也不需要它,它将作为 systemd 服务安装,可以设置为在启动时启动并运行直到机器关闭。

    【讨论】:

    • 感谢您的回复@hardillb。请问我该怎么做?
    • 使用标准工具,例如service mosquitto start 启动,systemctl enable mosquitto.service 启动启动。
    猜你喜欢
    • 1970-01-01
    • 2015-12-07
    • 1970-01-01
    • 2016-06-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-27
    • 1970-01-01
    相关资源
    最近更新 更多