base-files: add a init.d option that will start the syscall tracer
authorJohn Crispin <john@openwrt.org>
Thu, 26 Mar 2015 10:58:17 +0000 (10:58 +0000)
committerJohn Crispin <john@openwrt.org>
Thu, 26 Mar 2015 10:58:17 +0000 (10:58 +0000)
Signed-off-by: John Crispin <blogic@openwrt.org>
SVN-Revision: 45009

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

index 695fc166fbcd1af6432016511f63d723174a0504..e0de0737331c5cb1b4cbfc3967c860515851d10a 100755 (executable)
@@ -97,7 +97,7 @@ ${INIT_TRACE:+set -x}
 . "$initscript"
 
 [ -n "$USE_PROCD" ] && {
-       EXTRA_COMMANDS="${EXTRA_COMMANDS} running"
+       EXTRA_COMMANDS="${EXTRA_COMMANDS} running trace"
 
        . $IPKG_INSTROOT/lib/functions/procd.sh
        basescript=$(readlink "$initscript")
@@ -114,6 +114,11 @@ ${INIT_TRACE:+set -x}
                fi
        }
 
+       trace() {
+               TRACE_SYSCALLS=1
+               start "$@"
+       }
+
        stop() {
                stop_service "$@"
                procd_kill "$(basename ${basescript:-$initscript})" "$1"