No description
Find a file
Mike Kasick 7e36edd80f init: Safely restart services to avoid race conditions.
Previously, service restarts (either an explicit "restart", or a "stop,
start" pair) exhibited a race condition whereby the new (restarting)
service process was often spawned before the old (stopping) process had
terminated.  This may have resulted in the new service process failing to
acquire a limited resource (file lock, socket bind, etc.) that the old
process had not yet released.

Now, a stopping service remains in the SVC_RUNNING state until its exiting
process has been reaped by waitpid.  This prevents a "stop, start" sequence
from spawning a second service process before resources held by the first
are released.  This enables safe service restarts by stopping the service,
waiting for the old service process to terminate, and (only then) starting
the new service process.  In the event of "restarting" an already stopped
service, the previous behavior is maintained whereby the service is simply
started.

This scenario could be special-cased by the restart command, however, we
have observed instances where services are, unintentionally, stopped and
started "too quickly," and so simultaneous processes for the same service
should never be allowed.

Note that this commit alters the behaviors for explicit restarts of
critical and oneshot services.  Previously these serivces would simply be
restarted, whereas now, an explicit restart of a critical service counts as
a crash (which may result in a recovery reboot) and oneshot services go
into the disabled state.
2012-03-22 22:11:41 -04:00
adb adb,fastboot: add USB support for Intel Vendor ID 2012-01-17 12:08:06 -08:00
charger charger: make the almost-full frame only show when it's current level 2011-10-31 17:04:33 -07:00
cpio dist for dist_files 2010-12-09 10:33:27 -08:00
debuggerd DO NOT MERGE - disable memory dumps 2011-11-16 15:50:55 -08:00
fastboot fastboot: set the language local string 2012-01-23 13:12:23 -08:00
gpttool Add missing header to gpttool 2011-01-25 08:07:01 -08:00
include Rename LOG_ASSERT to ALOG_ASSERT 2012-01-17 17:56:20 +00:00
init init: Safely restart services to avoid race conditions. 2012-03-22 22:11:41 -04:00
libctest Automated import from //branches/master/...@140824,140824 2009-03-24 18:36:50 -07:00
libcutils Added rules to build 64-bit libraries: lib64cutils.a and lib64log.a 2012-03-22 08:56:06 -07:00
libdiskconfig Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) 2012-01-17 17:56:20 +00:00
liblinenoise Improve linenoise.c compatability. 2010-06-04 14:32:01 +08:00
liblog Added rules to build 64-bit libraries: lib64cutils.a and lib64log.a 2012-03-22 08:56:06 -07:00
libmincrypt make DumpPublicKeys write 32-bit values as unsigned 2010-01-29 10:47:38 -08:00
libnetutils Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) 2012-01-17 17:56:20 +00:00
libnl_2 libnl_2: Fix memory leaks 2011-11-01 15:56:22 -07:00
libpixelflinger Rename LOG_ASSERT to ALOG_ASSERT 2012-01-17 17:56:20 +00:00
libsysutils Remove log spam 2011-10-28 23:57:32 -07:00
libusbhost Rename (IF_)LOGD(_IF) to (IF_)ALOGD(_IF) 2012-01-17 17:56:19 +00:00
libzipfile Fix a call to memset(3) with reversed arguments. 2009-09-03 11:52:31 -07:00
logcat logcat: add sanity check 2011-10-17 11:40:06 -07:00
logwrapper logwrapper: reduce verbosity and fix usage 2012-02-28 13:55:57 -08:00
mkbootimg dist for dist_files 2010-12-09 10:33:27 -08:00
netcfg Support adding, deleting, and clearing IPv6 addrs. 2011-09-28 17:12:13 -07:00
nexus Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) 2012-01-17 17:56:20 +00:00
rootdir rootdir: convert all usages of $prop to ${prop} 2012-01-11 04:36:13 -08:00
run-as run-as: Bump the size of the internal packages list buffer. 2011-06-06 12:43:01 +02:00
sdcard Fix returning errno values which should be negative. 2011-07-22 22:05:27 +09:00
sh sh: null check signame list since sig 0 is not valid 2010-12-09 14:20:16 -08:00
toolbox Merge "Toolbox implementation of chown has a bad print" 2012-02-28 14:59:56 -08:00
.gitignore Don't compile abort_socket.c for host targets. It is only intended to run on Linux targets. 2009-05-26 13:23:23 -07:00
Android.mk Remove the simulator target from all makefiles. 2011-07-11 22:12:32 -07:00
CleanSpec.mk Raise the viking killer min free values to match the system properties 2011-01-28 22:56:18 -08:00
README auto import from //depot/cupcake/@135843 2009-03-03 19:32:55 -08:00
ThirdPartyProject.prop add meta-files about 3rd party projects 2010-07-16 11:41:39 -07:00

The system/ directory is intended for pieces of the world that are the
core of the embedded linux platform at the heart of Android.  These
essential bits are required for basic booting, operation, and debugging.

They should not depend on libraries outside of system/... (some of them
do currently -- they need to be updated or changed) and they should not
be required for the simulator build.

The license for all these pieces should be clean (Apache2, BSD, or MIT).

Currently system/bluetooth/... and system/extra/... have some pieces
with GPL/LGPL licensed code.

Assorted Issues:

- pppd depends on libutils for logging
- pppd depends on libcrypt/libcrypto
- init, linker, debuggerd, toolbox, usbd depend on libcutils
- should probably rename bionic to libc