mosquitto.service: mosquitto starts even if the network is offline

This patch changes the behavior of how mosquitto is starting using
systemd.

Currently it is starting only when the network is online, meaning that the
network is configured to a routable IP address.

With this patch, mosquitto is starting when the network is offline, does
not need to be configured. This is needed because the MQTT broker might
be used as an internal message bus which does not need the network to be
online.

Signed-off-by: Stavros Vagionitis <stavros.vagionitis@jci.com>
This commit is contained in:
Stavros Vagionitis 2020-02-14 09:59:46 +00:00 committed by Roger A. Light
parent 24e34434a4
commit 2488d6acf1
2 changed files with 4 additions and 4 deletions

View File

@ -1,8 +1,8 @@
[Unit]
Description=Mosquitto MQTT v3.1/v3.1.1 Broker
Documentation=man:mosquitto.conf(5) man:mosquitto(8)
After=network-online.target
Wants=network-online.target
After=network.target
Wants=network.target
[Service]
Type=notify

View File

@ -1,8 +1,8 @@
[Unit]
Description=Mosquitto MQTT v3.1/v3.1.1 Broker
Documentation=man:mosquitto.conf(5) man:mosquitto(8)
After=network-online.target
Wants=network-online.target
After=network.target
Wants=network.target
[Service]
ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf