diff options
author | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-12-22 18:56:09 +0000 |
---|---|---|
committer | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2012-12-22 18:56:09 +0000 |
commit | c0a700469527138643d745c7a17ba66e86e77a52 (patch) | |
tree | ac5cd21cba329b712ffbbdfb1b5cc2da64e8757d /package | |
parent | 61b2c378aea81c515d02436364f90e4d597d4266 (diff) |
base-files: add basic procd integration, let procd start (and restart) ubus instead of having an ubus init script
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@34866 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package')
-rw-r--r-- | package/base-files/Makefile | 2 | ||||
-rwxr-xr-x | package/base-files/files/etc/rc.common | 31 | ||||
-rw-r--r-- | package/ubus/Makefile | 3 |
3 files changed, 33 insertions, 3 deletions
diff --git a/package/base-files/Makefile b/package/base-files/Makefile index ec69e0cb3..63350f822 100644 --- a/package/base-files/Makefile +++ b/package/base-files/Makefile @@ -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) diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common index fa2df6cd2..78e2dd494 100755 --- a/package/base-files/files/etc/rc.common +++ b/package/base-files/files/etc/rc.common @@ -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 "$@" && :' diff --git a/package/ubus/Makefile b/package/ubus/Makefile index 617c76749..782079d77 100644 --- a/package/ubus/Makefile +++ b/package/ubus/Makefile @@ -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 |