From 3e7f636c2cbc7483888fef1a032e98bdeb463fe9 Mon Sep 17 00:00:00 2001 From: Gabe Evans Date: Sat, 31 Oct 2015 21:27:17 +0000 Subject: [PATCH] mosquitto: systemd support Signed-off-by: Gabe Evans Signed-off-by: Thomas Petazzoni --- package/mosquitto/mosquitto.mk | 8 ++++++++ package/mosquitto/mosquitto.service | 10 ++++++++++ 2 files changed, 18 insertions(+) create mode 100644 package/mosquitto/mosquitto.service 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