netifd: enable coredumps again
authorJohn Crispin <john@openwrt.org>
Mon, 9 Dec 2013 17:29:34 +0000 (17:29 +0000)
committerJohn Crispin <john@openwrt.org>
Mon, 9 Dec 2013 17:29:34 +0000 (17:29 +0000)
got broken due procd startup. Requires procd resource limit patch.

Signed-off-by: Ulrich Weber <uw@xyne.com>
SVN-Revision: 39020

package/network/config/netifd/files/etc/init.d/network
package/system/procd/files/procd.sh

index 387fdbe5dda6f75dd52f5841dcb65c495a4fa0be..9427a8635723f37f444f9fb62cf5f5c6f6882717 100755 (executable)
@@ -6,13 +6,13 @@ STOP=90
 USE_PROCD=1
 
 start_service() {
-       [ -e /proc/sys/kernel/core_pattern ] && {
-               ulimit -c unlimited
-               echo '/tmp/%e.%p.%s.%t.core' > /proc/sys/kernel/core_pattern
-       }
        procd_open_instance
        procd_set_param command /sbin/netifd
        procd_set_param respawn
+       [ -e /proc/sys/kernel/core_pattern ] && {
+               procd_set_param limits core="unlimited"
+               echo '/tmp/%e.%p.%s.%t.core' > /proc/sys/kernel/core_pattern
+       }
        procd_close_instance
 }
 
index 2f97a5d7d2855198cac8d92eeed61e76fdee5a6d..73beaaf6b240ffa111378fe3cd543a9bc161aa4b 100644 (file)
@@ -17,6 +17,7 @@
 #     data: arbitrary name/value pairs for detecting config changes (table)
 #     file: configuration files (array)
 #     netdev: bound network device (detects ifindex changes)
+#     limits: resource limits (passed to the process)
 #
 #   No space separation is done for arrays/tables - use one function argument per command line argument
 #
@@ -123,7 +124,7 @@ _procd_set_param() {
        local type="$1"; shift
 
        case "$type" in
-               env|data)
+               env|data|limits)
                        _procd_add_table "$type" "$@"
                ;;
                command|netdev|file|respawn)
@@ -177,7 +178,7 @@ _procd_append_param() {
 
        json_select "$type"
        case "$type" in
-               env|data)
+               env|data|limits)
                        _procd_add_table_data "$@"
                ;;
                command|netdev|file|respawn)