mosquitto: systemd support

Signed-off-by: Gabe Evans <gabe@hashrabbit.co>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
This commit is contained in:
Gabe Evans 2015-10-31 21:27:17 +00:00 committed by Thomas Petazzoni
parent 774c599fc5
commit 3e7f636c2c
2 changed files with 18 additions and 0 deletions

View File

@ -83,6 +83,14 @@ define MOSQUITTO_INSTALL_INIT_SYSV
$(TARGET_DIR)/etc/init.d/S50mosquitto
endef
define MOSQUITTO_INSTALL_INIT_SYSTEMD
$(INSTALL) -D -m 644 package/mosquitto/mosquitto.service \
$(TARGET_DIR)/usr/lib/systemd/system/mosquitto.service
mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
ln -fs ../../../../usr/lib/systemd/system/mosquitto.service \
$(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/mosquitto.service
endef
define MOSQUITTO_USERS
mosquitto -1 nogroup -1 * - - - Mosquitto user
endef

View File

@ -0,0 +1,10 @@
[Unit]
Description=Mosquitto MQTT broker
[Service]
ExecStart=/usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
ExecReload=/bin/kill -HUP $MAINPID
Restart=always
[Install]
WantedBy=multi-user.target