summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabe Evans <gabe@hashrabbit.co>2015-10-31 21:27:17 +0000
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-11-02 21:34:22 +0100
commit3e7f636c2cbc7483888fef1a032e98bdeb463fe9 (patch)
tree35cf4e1657c75929a310b4b6848724bc98e93ac9
parent774c599fc568a5a12feff0b633f29f7ca38814ca (diff)
downloadbuildroot-3e7f636c2cbc7483888fef1a032e98bdeb463fe9.tar.gz
buildroot-3e7f636c2cbc7483888fef1a032e98bdeb463fe9.zip
mosquitto: systemd support
Signed-off-by: Gabe Evans <gabe@hashrabbit.co> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
-rw-r--r--package/mosquitto/mosquitto.mk8
-rw-r--r--package/mosquitto/mosquitto.service10
2 files changed, 18 insertions, 0 deletions
diff --git a/package/mosquitto/mosquitto.mk b/package/mosquitto/mosquitto.mk
index 73365f9e02..efeb32d2ee 100644
--- a/package/mosquitto/mosquitto.mk
+++ b/package/mosquitto/mosquitto.mk
@@ -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
diff --git a/package/mosquitto/mosquitto.service b/package/mosquitto/mosquitto.service
new file mode 100644
index 0000000000..2d1939d1c7
--- /dev/null
+++ b/package/mosquitto/mosquitto.service
@@ -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
OpenPOWER on IntegriCloud