Why logd is not respawned if crashes

Hi there,

In start_service_daemon() function (file /etc/init.d/log) there are the following lines:

    procd_set_param command "/sbin/logd"
    procd_append_param command -S "${log_buffer_size}"
    procd_set_param respawn 5 1 -1

My understanding is that -1 here means that there will be no respawn if logd crashes, right?
I checked other service's procd_set_param respawn on my build, and they all use default respawn parameters hence restart service if it crashes. I am wondering why logd is different. When I checked git history for ( package/system/ubox/files/log.init) I saw that it was changed from the default settings to the 5 1 -1 array but it is not clear why.

Any ideas?
The reason why I am asking is because I noticed that 1 out of 100 boots logd is not running that makes logread unhappy :slight_smile:


No, it means the upper limit for respawn attempts is -1, so unset. Means procd should try respawning forever. There's some int -> unsigned -> int conversion going on in procd itself though, so not sure if -1 is going to actually end up as -1 in the service state.

A value of 0 should convey the same meaning (no limit, retry forever) and should work in any case.