No description
Find a file
Adam Langley ecc14a5958 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
2022-09-12 15:16:35 +01:00
bootstat Merge "boot_reason: Add reasons for boot_reason_test.sh" 2022-07-14 22:45:18 +00:00
cli-test [LSC] Add LOCAL_LICENSE_KINDS to system/core 2021-02-19 12:59:05 -08:00
code_coverage [LSC] Add LOCAL_LICENSE_KINDS to system/core 2021-02-19 12:59:05 -08:00
debuggerd Resolve ro.debuggable at build time 2022-09-01 13:32:36 +00:00
diagnose_usb Support building diagnose_usb against musl 2021-12-16 14:04:06 -08:00
fastboot Add io_uring support to fastboot 2022-08-11 18:58:43 -07:00
fs_mgr Merge "vts_libsnapshot_test: Fix test flakiness." 2022-09-08 19:44:05 +00:00
gatekeeperd Depend on KeyMint HAL via default 2021-12-02 08:16:25 +00:00
healthd healthd: Fix charger_res_images_vendor install location 2022-08-26 15:58:07 +02:00
include Remove include/backtrace symlink. 2020-10-20 12:46:14 -07:00
init init: Add option to listen on sockets before starting service. 2022-09-12 15:16:35 +01:00
janitors Add the two best build system janitors. 2019-03-25 10:25:13 -07:00
libappfuse [LSC] Add LOCAL_LICENSE_KINDS to system/core 2021-02-19 12:59:05 -08:00
libasyncio Set min_sdk_version 2021-12-02 09:23:42 +09:00
libbinderwrapper [LSC] Add LOCAL_LICENSE_KINDS to system/core 2021-02-19 12:59:05 -08:00
libcrypto_utils Set min_sdk_version 2021-12-02 09:23:42 +09:00
libcutils Merge "Add fdsan capabilities for native handles" 2022-09-06 22:48:31 +00:00
libdiskconfig Tweak linux_glibc properties for musl builds in system/core 2022-03-24 15:59:08 -07:00
libgrallocusage Make apex_available explicit 2022-02-09 11:37:19 -08:00
libkeyutils Make libfs_mgr dependencies vendor_ramdisk_available. 2021-07-23 16:50:06 -07:00
libmodprobe libmodprobe: check blockedlist if load failed 2022-08-06 04:48:55 +00:00
libnetutils Rewrite function declarators without prototypes 2022-06-22 16:59:22 +08:00
libpackagelistparser Promote HWASan tests to presubmit. 2022-06-17 22:18:49 +00:00
libprocessgroup libprocessgroup: Add I/O scheduler attributes to task_profiles.json 2022-08-25 14:01:01 -07:00
libsparse libsparse: Don't spam errors in sparse_file_import_auto. 2022-06-01 18:36:04 -07:00
libstats Promote HWASan tests to presubmit. 2022-08-10 19:50:31 +00:00
libsuspend libsuspend: vendor_available. 2021-11-02 13:52:40 -07:00
libsync Declare the headers of the ndk_library 2022-09-08 21:59:20 +00:00
libsystem Relax requirements on android_ycbcr to allow P010 2022-02-17 10:54:15 -08:00
libsysutils Fix 32-bit userspace on 64-bit kernel quota2 compatibility. 2021-10-25 16:24:49 -07:00
libusbhost libusbhost: factor out frameworks descriptors -> byte[] code. 2022-01-24 13:35:20 -08:00
libutils Remove unnecessary std::unary_function base classes 2022-08-26 20:24:57 -07:00
libvndksupport Replace #apex with #systemapi 2022-07-17 17:43:24 +09:00
llkd llkd: Disable in userdebug builds by default 2021-11-04 16:21:46 -07:00
mini_keyctl Merge "Make libmini_keyctl_static available in recovery" 2021-11-23 17:54:31 +00:00
mkbootfs Make 'mkbootfs' print a usage message for insufficent args. 2022-07-12 16:00:07 -07:00
property_service Promote HWASan tests to presubmit. 2022-05-06 19:08:21 +00:00
reboot [LSC] Add LOCAL_LICENSE_KINDS to system/core 2021-02-19 12:59:05 -08:00
rootdir Prepare /data/property before load_persist_props 2022-08-18 10:03:02 +09:00
run-as [LSC] Add LOCAL_LICENSE_KINDS to system/core 2021-02-19 12:59:05 -08:00
sdcard [LSC] Add LOCAL_LICENSE_KINDS to system/core 2021-02-19 12:59:05 -08:00
set-verity-state remount: Simplify fs_mgr_overlayfs_setup. 2022-08-30 18:49:37 -07:00
shell_and_utilities Update shell_and_utilities docs for T. 2022-03-05 08:12:29 -08:00
storaged storaged: Avoid divide-by-zero in performance measurement 2022-05-18 17:05:54 +09:00
toolbox toolbox/generate-input.h-labels.py: python3. 2021-08-17 14:34:55 -07:00
trusty trusty: Increase size of ACVP shared memory 2022-08-22 19:43:54 -07:00
usbd usbd - remove unused libcutils dep 2021-06-28 23:56:29 +00:00
watchdogd [LSC] Add LOCAL_LICENSE_KINDS to system/core 2021-02-19 12:59:05 -08:00
.clang-format Add a 2 width option of clang format. 2017-03-10 13:01:39 -08:00
.clang-format-2 Move clang-formats to build. 2019-01-18 14:26:33 -08:00
.clang-format-4 Move clang-formats to build. 2019-01-18 14:26:33 -08:00
.gitignore Ignore adb/*.pyc files 2015-08-11 12:59:58 -07:00
CleanSpec.mk snapshotctl don't auto-merge. 2020-03-03 13:19:49 -08:00
METADATA Add METADATA to system/core: Apache2+BSD=NOTICE 2020-04-29 13:16:41 -07:00
MODULE_LICENSE_APACHE2 auto import from //depot/cupcake/@135843 2013-07-30 13:56:49 -07:00
OWNERS Remove baligh@ from owners. CodeShuffle done. 2020-10-17 00:28:10 +00:00
PREUPLOAD.cfg Configure rustfmt for preupload hook 2022-04-06 21:11:09 +00:00
rustfmt.toml Configure rustfmt for preupload hook 2022-04-06 21:11:09 +00:00