base-files: add basic procd integration, let procd start (and restart) ubus instead...
authorFelix Fietkau <nbd@openwrt.org>
Sat, 22 Dec 2012 18:56:09 +0000 (18:56 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 22 Dec 2012 18:56:09 +0000 (18:56 +0000)
SVN-Revision: 34866

package/base-files/Makefile
package/base-files/files/etc/rc.common
package/ubus/Makefile

index ec69e0cb3cd2a71a3d5969631767d05c6b494b21..63350f822ac0e88e8297cfc016d7df10dfa7b57e 100644 (file)
@@ -28,7 +28,7 @@ endif
 define Package/base-files
   SECTION:=base
   CATEGORY:=Base system
-  DEPENDS:=+netifd +libc
+  DEPENDS:=+netifd +libc +procd
   TITLE:=Base filesystem for OpenWrt
   URL:=http://openwrt.org/
   VERSION:=$(PKG_RELEASE)-$(REVISION)
index fa2df6cd25d7b778b08b4400a204d473fd0098f0..78e2dd49409db557a91ad6e386b5e29e4635bb16 100755 (executable)
@@ -75,10 +75,41 @@ $EXTRA_HELP
 EOF
 }
 
+# for procd
+start_service() {
+       return 0
+}
+
+stop_service() {
+       return 0
+}
+
 ${INIT_TRACE:+set -x}
 
 . "$initscript"
 
+[ -n "$USE_PROCD" ] && {
+       . $IPKG_INSTROOT/lib/functions/procd.sh
+
+       rc_procd() {
+               procd_open_service "$(basename "$initscript")" "$initscript"
+               "$@"
+               procd_close_service
+       }
+
+       start() {
+               rc_procd start_service "$@"
+       }
+
+       stop() {
+               procd_kill "$(basename "$initscript")" "$1"
+       }
+
+       reload() {
+               start
+       }
+}
+
 ALL_COMMANDS="start stop reload restart boot shutdown enable disable enabled depends ${EXTRA_COMMANDS}"
 list_contains ALL_COMMANDS "$action" || action=help
 [ "$action" = "reload" ] && action='eval reload "$@" || restart "$@" && :'
index 617c76749b1d742047807b769ea0c8a43405dbd0..782079d7759a4f6f5299fd4552c886ccb6c36554 100644 (file)
@@ -63,8 +63,7 @@ define Package/ubus/install
 endef
 
 define Package/ubusd/install
-       $(INSTALL_DIR) $(1)/sbin $(1)/etc/init.d
-       $(INSTALL_BIN) ./files/ubus.init $(1)/etc/init.d/ubus
+       $(INSTALL_DIR) $(1)/sbin
        $(CP) $(PKG_INSTALL_DIR)/usr/sbin/ubusd $(1)/sbin/
 endef