summaryrefslogtreecommitdiff
path: root/code_coverage/empty_policy/code_coverage.arm.policy
diff options
context:
space:
mode:
authorAdam Langley <agl@chromium.org>2022-05-11 22:32:47 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-11-15 01:50:04 +0000
commitec18f508f9934fc9548fff6b0532452200defdbe (patch)
treeda70ea0560c513e3d0a36bb115cdf3c9c0330b5b /code_coverage/empty_policy/code_coverage.arm.policy
parent9c6a104cfeb943e7bf8124ca21cfa4eaefb11160 (diff)
init: Add option to listen on sockets before starting service.
Review note: Original change was a p-o-c by agl in https://r.android.com/2094350 which I think is actually production quality. I'm just taking it over so that he doesn't get spammed by any review comments as that's not a good use of his time. Needed for the hardware entropy daemon (see bug). Original commit message: If one needs to create a service that synchronously starts listening on a socket then there are currently no good options. The traditional UNIX solution is to have the service create the socket and then daemonise. In this situation, init could start the service with `exec_start` and yet not block forever because the service forks and exits. However, when the initial child process exits, init kills the daemon process: > init: Killed 1 additional processes from a oneshot process group for > service 'foo'. This is new behavior, previously child processes > would not be killed in this case. Next, there is a `socket` option for services and (although the documentation didn't nail this down), the socket is created synchronously by `start`. However, init doesn't call `listen` on the socket so, until the service starts listening on the socket itself, clients will get ECONNREFUSED. This this change adds a `+listen` option, similar to `+passcred` which allows a socket service to reliably handle connections. Bug: 243933553 Test: Started prng_seeder from init using the new listen flag Change-Id: I91b3b2b1fd38cc3d96e19e92b76c8e95788191d5 Merged-In: I91b3b2b1fd38cc3d96e19e92b76c8e95788191d5 (cherry picked from commit ecc14a595809846cd09760d2c59b1fdfa9660ce8) (cherry picked from commit 56a658874be2e8f5bdda288cb4fc37353c07ca37) Merged-In: I91b3b2b1fd38cc3d96e19e92b76c8e95788191d5
Diffstat (limited to 'code_coverage/empty_policy/code_coverage.arm.policy')
0 files changed, 0 insertions, 0 deletions