ubusd: add an init script
authorFelix Fietkau <nbd@openwrt.org>
Thu, 20 Oct 2011 15:01:12 +0000 (15:01 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 20 Oct 2011 15:01:12 +0000 (15:01 +0000)
SVN-Revision: 28496

package/ubus/Makefile
package/ubus/files/ubus.init [new file with mode: 0755]

index c117453cb5b0b4ce8393d768cd2cda30115de646..d80309cdaffca1730be285ee0484b89072ab9521 100644 (file)
@@ -46,7 +46,8 @@ define Package/ubus/install
 endef
 
 define Package/ubusd/install
-       $(INSTALL_DIR) $(1)/sbin
+       $(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d
+       $(INSTALL_BIN) ./files/ubus.init $(1)/etc/init.d/ubus
        $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ubusd $(1)/sbin/
 endef
 
diff --git a/package/ubus/files/ubus.init b/package/ubus/files/ubus.init
new file mode 100755 (executable)
index 0000000..7fcf106
--- /dev/null
@@ -0,0 +1,11 @@
+#!/bin/sh /etc/rc.common
+START=11
+PIDFILE=/var/run/ubusd.pid
+
+start() {
+       start-stop-daemon -S -b -m -p $PIDFILE -x /sbin/ubusd
+}
+
+stop() {
+       start-stop-daemon -K -x /sbin/ubusd -p $PIDFILE
+}