logcatd.rc 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #
  2. # init scriptures for logcatd persistent logging.
  3. #
  4. # Make sure any property changes are only performed with /data mounted, after
  5. # post-fs-data state because otherwise behavior is undefined. The exceptions
  6. # are device adjustments for logcatd service properties (persist.* overrides
  7. # notwithstanding) for logd.logpersistd.size and logd.logpersistd.buffer.
  8. # persist to non-persistent trampolines to permit device properties can be
  9. # overridden when /data mounts, or during runtime.
  10. on property:persist.logd.logpersistd.size=256
  11. setprop persist.logd.logpersistd.size ""
  12. setprop logd.logpersistd.size ""
  13. on property:persist.logd.logpersistd.size=*
  14. # expect /init to report failure if property empty (default)
  15. setprop logd.logpersistd.size ${persist.logd.logpersistd.size}
  16. on property:persist.logd.logpersistd.buffer=all
  17. setprop persist.logd.logpersistd.buffer ""
  18. setprop logd.logpersistd.buffer ""
  19. on property:persist.logd.logpersistd.buffer=*
  20. # expect /init to report failure if property empty (default)
  21. setprop logd.logpersistd.buffer ${persist.logd.logpersistd.buffer}
  22. on property:persist.logd.logpersistd=logcatd
  23. setprop logd.logpersistd logcatd
  24. # enable, prep and start logcatd service
  25. on load_persist_props_action
  26. setprop logd.logpersistd.enable true
  27. on property:logd.logpersistd.enable=true && property:logd.logpersistd=logcatd
  28. # all exec/services are called with umask(077), so no gain beyond 0700
  29. mkdir /data/misc/logd 0700 logd log
  30. start logcatd
  31. # stop logcatd service and clear data
  32. on property:logd.logpersistd.enable=true && property:logd.logpersistd=clear
  33. setprop persist.logd.logpersistd ""
  34. stop logcatd
  35. # logd for clear of only our files in /data/misc/logd
  36. exec - logd log -- /system/bin/logcat -c -f /data/misc/logd/logcat -n ${logd.logpersistd.size:-256}
  37. setprop logd.logpersistd ""
  38. # stop logcatd service
  39. on property:logd.logpersistd=stop
  40. setprop persist.logd.logpersistd ""
  41. stop logcatd
  42. setprop logd.logpersistd ""
  43. on property:logd.logpersistd.enable=false
  44. stop logcatd
  45. # logcatd service
  46. service logcatd /system/bin/logcatd -L -b ${logd.logpersistd.buffer:-all} -v threadtime -v usec -v printable -D -f /data/misc/logd/logcat -r 1024 -n ${logd.logpersistd.size:-256} --id=${ro.build.id}
  47. class late_start
  48. disabled
  49. # logd for write to /data/misc/logd, log group for read from log daemon
  50. user logd
  51. group log
  52. writepid /dev/cpuset/system-background/tasks
  53. oom_score_adjust -600