diff options
author | Felix Fietkau <nbd@openwrt.org> | 2012-12-22 18:56:09 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2012-12-22 18:56:09 +0000 |
commit | d8c3a7ef1946f46062bacd0f657882ed5ce1add7 (patch) | |
tree | ac5cd21cba329b712ffbbdfb1b5cc2da64e8757d /package/base-files/files | |
parent | 56e6c5df09c5e58a7546d88e2927a27e6d7803d6 (diff) | |
download | master-187ad058-d8c3a7ef1946f46062bacd0f657882ed5ce1add7.tar.gz master-187ad058-d8c3a7ef1946f46062bacd0f657882ed5ce1add7.tar.bz2 master-187ad058-d8c3a7ef1946f46062bacd0f657882ed5ce1add7.zip |
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/base-files/files')
-rwxr-xr-x | package/base-files/files/etc/rc.common | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/package/base-files/files/etc/rc.common b/package/base-files/files/etc/rc.common index fa2df6cd25..78e2dd4940 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 "$@" && :' |