From fdeca99c4b6d1b209b57a56ebd843d556cd677c9 Mon Sep 17 00:00:00 2001 From: Tom Cherry Date: Thu, 6 Jun 2019 11:05:52 -0700 Subject: [PATCH] init.rc: move rlimit setting earlier There is no reason that rlimits cannot be set earlier than they are, and apexd-bootstrap may want to set the priority service option, which would require that these rlimits have been set, so we move these to the beginning of early-init. Bug: 134668377 Test: apexd-bootstrap can set the priorty service option Change-Id: I8040190cd4dc5e141784496ae65cfab80d9cad53 --- rootdir/init.rc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rootdir/init.rc b/rootdir/init.rc index 84fa46e75..29a0ad4ad 100644 --- a/rootdir/init.rc +++ b/rootdir/init.rc @@ -32,6 +32,12 @@ on early-init # cgroup for system_server and surfaceflinger mkdir /dev/memcg/system 0550 system system + # set RLIMIT_NICE to allow priorities from 19 to -20 + setrlimit nice 40 40 + + # Allow up to 32K FDs per process + setrlimit nofile 32768 32768 + start ueventd # Run apexd-bootstrap so that APEXes that provide critical libraries @@ -267,12 +273,6 @@ on init export DOWNLOAD_CACHE /data/cache - # set RLIMIT_NICE to allow priorities from 19 to -20 - setrlimit nice 40 40 - - # Allow up to 32K FDs per process - setrlimit nofile 32768 32768 - # This allows the ledtrig-transient properties to be created here so # that they can be chown'd to system:system later on boot write /sys/class/leds/vibrator/trigger "transient"