2016-07-07 18:24:51 +02:00
|
|
|
#
|
|
|
|
# init scriptures for logcatd persistent logging.
|
|
|
|
#
|
|
|
|
# Make sure any property changes are only performed with /data mounted, after
|
|
|
|
# post-fs-data state because otherwise behavior is undefined. The exceptions
|
|
|
|
# are device adjustments for logcatd service properties (persist.* overrides
|
2019-05-21 05:19:12 +02:00
|
|
|
# notwithstanding) for logd.logpersistd.size logd.logpersistd.rotate_kbytes and
|
|
|
|
# logd.logpersistd.buffer.
|
2016-07-07 18:24:51 +02:00
|
|
|
|
|
|
|
# persist to non-persistent trampolines to permit device properties can be
|
|
|
|
# overridden when /data mounts, or during runtime.
|
2019-05-21 05:19:12 +02:00
|
|
|
on property:persist.logd.logpersistd.count=*
|
|
|
|
# expect /init to report failure if property empty (default)
|
|
|
|
setprop persist.logd.logpersistd.size ${persist.logd.logpersistd.count}
|
|
|
|
|
2016-07-07 18:24:51 +02:00
|
|
|
on property:persist.logd.logpersistd.size=*
|
|
|
|
setprop logd.logpersistd.size ${persist.logd.logpersistd.size}
|
|
|
|
|
2019-05-21 05:19:12 +02:00
|
|
|
on property:persist.logd.logpersistd.rotate_kbytes=*
|
2019-07-12 09:09:36 +02:00
|
|
|
setprop logd.logpersistd.rotate_kbytes ${persist.logd.logpersistd.rotate_kbytes}
|
2016-07-07 18:24:51 +02:00
|
|
|
|
|
|
|
on property:persist.logd.logpersistd.buffer=*
|
|
|
|
setprop logd.logpersistd.buffer ${persist.logd.logpersistd.buffer}
|
|
|
|
|
2015-08-14 22:02:51 +02:00
|
|
|
on property:persist.logd.logpersistd=logcatd
|
2016-07-07 18:24:51 +02:00
|
|
|
setprop logd.logpersistd logcatd
|
|
|
|
|
|
|
|
# enable, prep and start logcatd service
|
|
|
|
on load_persist_props_action
|
|
|
|
setprop logd.logpersistd.enable true
|
|
|
|
|
|
|
|
on property:logd.logpersistd.enable=true && property:logd.logpersistd=logcatd
|
2015-08-14 22:02:51 +02:00
|
|
|
# all exec/services are called with umask(077), so no gain beyond 0700
|
|
|
|
mkdir /data/misc/logd 0700 logd log
|
|
|
|
start logcatd
|
|
|
|
|
2016-07-07 18:24:51 +02:00
|
|
|
# stop logcatd service and clear data
|
|
|
|
on property:logd.logpersistd.enable=true && property:logd.logpersistd=clear
|
|
|
|
setprop persist.logd.logpersistd ""
|
2016-06-06 20:22:13 +02:00
|
|
|
stop logcatd
|
|
|
|
# logd for clear of only our files in /data/misc/logd
|
2016-07-07 18:24:51 +02:00
|
|
|
exec - logd log -- /system/bin/logcat -c -f /data/misc/logd/logcat -n ${logd.logpersistd.size:-256}
|
|
|
|
setprop logd.logpersistd ""
|
|
|
|
|
|
|
|
# stop logcatd service
|
|
|
|
on property:logd.logpersistd=stop
|
2016-06-06 20:22:13 +02:00
|
|
|
setprop persist.logd.logpersistd ""
|
2016-07-07 18:24:51 +02:00
|
|
|
stop logcatd
|
|
|
|
setprop logd.logpersistd ""
|
2016-06-06 20:22:13 +02:00
|
|
|
|
2016-07-07 18:24:51 +02:00
|
|
|
on property:logd.logpersistd.enable=false
|
2016-06-06 20:22:13 +02:00
|
|
|
stop logcatd
|
|
|
|
|
2016-07-07 18:24:51 +02:00
|
|
|
# logcatd service
|
2019-07-05 03:09:38 +02:00
|
|
|
service logcatd /system/bin/logcatd -L -b ${logd.logpersistd.buffer:-all} -v threadtime -v usec -v printable -D -f /data/misc/logd/logcat -r ${logd.logpersistd.rotate_kbytes:-2048} -n ${logd.logpersistd.size:-256} --id=${ro.build.id}
|
2015-08-14 22:02:51 +02:00
|
|
|
class late_start
|
|
|
|
disabled
|
|
|
|
# logd for write to /data/misc/logd, log group for read from log daemon
|
|
|
|
user logd
|
|
|
|
group log
|
2015-09-21 23:25:34 +02:00
|
|
|
writepid /dev/cpuset/system-background/tasks
|
2017-05-30 18:01:38 +02:00
|
|
|
oom_score_adjust -600
|