Include service-cleaner.sh which kills looping services 30s after boot

This commit is contained in:
Pierre-Hugues Husson 2018-05-14 17:04:27 +02:00
parent 71789c3977
commit 6eaf501e68
4 changed files with 18 additions and 1 deletions

View File

@ -49,7 +49,8 @@ PRODUCT_COPY_FILES += \
device/phh/treble/fixSPL/getSPL.arm:system/bin/getSPL
PRODUCT_COPY_FILES += \
device/phh/treble/empty:system/phh/empty
device/phh/treble/empty:system/phh/empty \
device/phh/treble/service-cleaner.sh:system/bin/service-cleaner.sh
PRODUCT_PACKAGES += \
treble-environ-rc

View File

@ -2,3 +2,4 @@
/system/bin/vndk-detect u:object_r:vndk_detect_exec:s0
/system/etc/usb_audio_policy_configuration.xml u:object_r:vendor_configs_file:s0
/system/bin/rw-system.sh u:object_r:phhsu_exec:s0
/system/bin/service-cleaner.sh u:object_r:phhsu_exec:s0

9
service-cleaner.sh Normal file
View File

@ -0,0 +1,9 @@
#!/system/bin/sh
sleep 30
getprop | \
grep restarting | \
sed -nE -e 's/\[([^]]*).*/\1/g' -e 's/init.svc.(.*)/\1/p' |
while read svc ;do
setprop ctl.stop $svc
done

View File

@ -3,3 +3,9 @@ on post-fs
exec - root -- /system/bin/rw-system.sh
mount none /system/etc/usb_audio_policy_configuration.xml /vendor/etc/usb_audio_policy_configuration.xml bind
export LD_CONFIG_FILE /system/etc/ld.config.${persist.sys.vndk}.txt
service phh_service_cleaner /system/bin/service-cleaner.sh
disabled
on property:sys.boot_completed=1
start phh_service_cleaner