diff --git a/net/mosquitto/Makefile b/net/mosquitto/Makefile index 4ed8bc45b..26d38aa6e 100644 --- a/net/mosquitto/Makefile +++ b/net/mosquitto/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2011 OpenWrt.org +# Copyright (C) 2011,2012 OpenWrt.org # Copyright (C) 2010 Jo-Philipp Wich # # This is free software, licensed under the GNU General Public License v2. @@ -72,6 +72,8 @@ define Package/mosquitto/install $(INSTALL_BIN) $(PKG_BUILD_DIR)/src/mosquitto $(1)/usr/sbin/mosquitto $(INSTALL_DIR) $(1)/etc/mosquitto $(INSTALL_CONF) $(PKG_BUILD_DIR)/mosquitto.conf $(1)/etc/mosquitto/mosquitto.conf + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_BIN) ./files/mosquitto.init $(1)/etc/init.d/mosquitto endef define Package/mosquitto-client/install diff --git a/net/mosquitto/files/mosquitto.init b/net/mosquitto/files/mosquitto.init new file mode 100755 index 000000000..b6ce6177e --- /dev/null +++ b/net/mosquitto/files/mosquitto.init @@ -0,0 +1,18 @@ +#!/bin/sh /etc/rc.common +# Basic init script for mosquitto +# April 2012, OpenWrt.org + +START=80 +APP=`which mosquitto` + +SERVICE_DAEMONIZE=1 +SERVICE_WRITE_PID=1 + +start() { + user_exists mosquitto 200 || user_add mosquitto 200 + service_start $APP -c /etc/mosquitto/mosquitto.conf +} + +stop() { + service_stop $APP +}