我正在尝试在Ubuntu 16.04上运行Mosquitto MQTT Broker。我有来自14.04的说明,但是由于16.04不再使用启动,所以我不知道如何转换为systemd。
以下是14.04的命令:
description "Mosquitto MQTT broker"
start on net-device-up
respawn
exec /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
编辑:
到目前为止,这就是我要做的。当我重新启动并运行时systemctl status mosquitto.service
,显示mosquitto已加载但未激活:
[Unit]
Description=Mosquitto MQTT Broker
[Service]
WorkingDirectory=/usr/sbin/mosquitto
ExecStart=/etc/mosquitto/mosquitto.conf
Restart=always
[Install]
WantedBy=multi-user.target
编辑2:
冉sudo systemctl enable mosquitto.service
。现在错误退出代码为:
Process: 1720 ExecStart=/etc/mosquitto/mosquitto.conf (code=exited, status=200/CHDIR)
-c option
?