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:
parent
774c599fc5
commit
3e7f636c2c
@ -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
|
||||
|
10
package/mosquitto/mosquitto.service
Normal file
10
package/mosquitto/mosquitto.service
Normal 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
|
Loading…
Reference in New Issue
Block a user