summaryrefslogtreecommitdiffstats
path: root/init
Commit message (Collapse)AuthorAgeFilesLines
* am 39021a48: am 83ada447: Merge changes Ib54f39fd,I7e36edd8Colin Cross2013-06-244-15/+38
|\ | | | | | | | | | | * commit '39021a48a0e0687c654423acd5a4c99a1d79440d': init: Retain traditional restart behavior for critical and oneshot services. init: Safely restart services to avoid race conditions.
| * am 83ada447: Merge changes Ib54f39fd,I7e36edd8Colin Cross2013-06-244-15/+38
| |\ | | | | | | | | | | | | | | | * commit '83ada447aed69dfcd0a88e952eced8db1e4d6584': init: Retain traditional restart behavior for critical and oneshot services. init: Safely restart services to avoid race conditions.
| | * Merge changes Ib54f39fd,I7e36edd8Colin Cross2013-06-244-15/+38
| | |\ | | | | | | | | | | | | | | | | | | | | * changes: init: Retain traditional restart behavior for critical and oneshot services. init: Safely restart services to avoid race conditions.
| | | * init: Retain traditional restart behavior for critical and oneshot services.Mike Kasick2012-03-224-11/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds an SVC_RESTART state that's used for an explicit "restart" of a running service. This retains the traditional restart behavior for critical and oneshot services (previously altered by 7e36edd8), whereby these services are "simply restarted" instead of counting as a crash (for a critical serivce) or going into the disabled state (for a oneshot service).
| | | * init: Safely restart services to avoid race conditions.Mike Kasick2012-03-221-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | am 99c1a416: resolved conflicts for merge of 95a41f6b to stage-aosp-masterColin Cross2013-06-175-88/+58
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '99c1a4168ba792437f298d31cd4631ff01661476': init: fix copying boot properties toolbox: hide property implementation from watchprops init: verify size of property buffers passed to property_get init: move the system property writer implementation init: switch property_get to use __system_property_get
| * | | resolved conflicts for merge of 95a41f6b to stage-aosp-masterColin Cross2013-06-175-88/+58
| |\ \ \ | | |/ / | | | | | | | | Change-Id: Icfae29edf989fb43a7f0b8bda188a9807f76a3b9
| | * | init: fix copying boot propertiesColin Cross2013-06-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous patch "init: verify size of property buffers passed to property_get" incorrectly modified one of the callers, resulting in ro.serialno, ro.bootmode, ro.baseband, and ro.bootloader always being set to their default values. Bug: 9469860 (cherry picked from commit 67e3663fc93c65b69b5d121db05b0833b98d97f1) Change-Id: Ia7b337e1fab6e334729f47ee1269e6c736615177
| | * | init: verify size of property buffers passed to property_getColin Cross2013-06-172-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Verify that the buffer passed as the value parameter to property_get is always big enough. (cherry picked from commit 88ac54a4e8d2a63e4fd9c465e115795ace316776) Change-Id: Iacc2b42bfe4069e0bfcbb1c48474f30126a93139
| | * | init: move the system property writer implementationColin Cross2013-06-171-51/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the system property writer implementation into bionic to keep it next to the reader implementation and allow for better testing. (cherry picked from commit 9f5af635010a7ba92edf1fca543f7271cc9d75c8) Change-Id: Idf6100d1d0170751acd5163a22597912bff480f0
| | * | init: switch property_get to use __system_property_getColin Cross2013-06-175-39/+34
| | | | | | | | | | | | | | | | | | | | | | | | (cherry picked from commit 2deedfe0b1ac86ebd62d19cf7da9e7dcb508ab09) Change-Id: If3fba2cc1dd5c167b0924ddfe42dbe2e6387208a
| | * | init: prevent action being added to the action_queue twiceColin Cross2013-06-101-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Property triggers may cause an action to be queued twice, resulting in a loop in the action queue. Keep actions that are not on the queue in the list_empty state (act->qlist->next == act->qlist), and only add them to the list if they are in that state. Bug: 8335133 Change-Id: I3a3ec18176cf19cbaa3a45220a03c7560eacfe79
* | | | am 76c58893: Free file handle for /firmware/image after useAjay Dudani2013-06-141-0/+1
|\ \ \ \ | |/ / / |/| | | | | | | | | | | * commit '76c5889325c2ada5dda07fd9af20a4a485978538': Free file handle for /firmware/image after use
| * | | Free file handle for /firmware/image after useAjay Dudani2013-06-131-0/+1
| | | | | | | | | | | | | | | | Change-Id: Id59e25486b45dffc87a89a961970a6e8128a5237
* | | | am 7e723498: Merge "Add permission for bluetooth app in non-primary users" ↵Matthew Xie2013-05-221-0/+8
|\ \ \ \ | |/ / / | | | | | | | | | | | | | | | | | | | | into jb-mr2-dev * commit '7e72349865db83d62f98eec8bca4b170712fe0e0': Add permission for bluetooth app in non-primary users
| * | | Merge "Add permission for bluetooth app in non-primary users" into jb-mr2-devMatthew Xie2013-05-221-0/+8
| |\ \ \
| | * | | Add permission for bluetooth app in non-primary usersMatthew Xie2013-05-221-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | bug 8954114 Change-Id: Id6a42f5a5beefa22c3cc8eecfb39a2222017a3b4
* | | | | am 49be2407: Revert "Add logic to fixup file contexts after a policy update."gcondra@google.com2013-05-201-6/+1
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | * commit '49be240735a06f44e1d91aa51dd299779ad36d96': Revert "Add logic to fixup file contexts after a policy update."
| * | | | Revert "Add logic to fixup file contexts after a policy update."repo sync2013-05-171-6/+1
| | | | | | | | | | | | | | | | | | | | This reverts commit ebcf93e3bf92bf46c54c8e0f2ec8936bb2db6aea.
* | | | | am 477e35d6: Revert "Add persistent property for SELinux enforcment status."gcondra@google.com2013-05-201-1/+0
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | * commit '477e35d6d56c7fe9b2305becdf3ed4f590ddfbd6': Revert "Add persistent property for SELinux enforcment status."
| * | | | Revert "Add persistent property for SELinux enforcment status."repo sync2013-05-171-1/+0
| | | | | | | | | | | | | | | | | | | | This reverts commit b89bdfde422eff751b3f939f10ab57e22af83eaa.
* | | | | am 8a387870: Revert "Reload policy after setting up the data partition."gcondra@google.com2013-05-204-9/+3
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | * commit '8a3878700eb9cd8ecf495cd01f15face5c3879c8': Revert "Reload policy after setting up the data partition."
| * | | | Revert "Reload policy after setting up the data partition."repo sync2013-05-174-9/+3
| | | | | | | | | | | | | | | | | | | | This reverts commit fee250d27a9c03af1ba439047b976d89563b1887.
* | | | | am 3d32cd93: Revert "Remove /system from the dirs to relabel."gcondra@google.com2013-05-201-0/+1
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | * commit '3d32cd938746215e5fa9b1a3c3b78903e043ae73': Revert "Remove /system from the dirs to relabel."
| * | | | Revert "Remove /system from the dirs to relabel."repo sync2013-05-171-0/+1
| | | | | | | | | | | | | | | | | | | | This reverts commit 3d4d07b2fa3b2447646d3c87a0b401e993ad8363.
* | | | | am 52351300: Revert "Add a version check for SELinux policy on device."gcondra@google.com2013-05-201-59/+0
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | * commit '52351300d156826bf22c493828571f45a1cea16a': Revert "Add a version check for SELinux policy on device."
| * | | | Revert "Add a version check for SELinux policy on device."repo sync2013-05-171-59/+0
| |/ / / | | | | | | | | | | | | This reverts commit 921be8b6568df0057c4eacbac2e1022b71e09620.
* | | | am 921be8b6: Add a version check for SELinux policy on device.gcondra@google.com2013-05-141-0/+59
|\ \ \ \ | |/ / / | | | | | | | | | | | | * commit '921be8b6568df0057c4eacbac2e1022b71e09620': Add a version check for SELinux policy on device.
| * | | Add a version check for SELinux policy on device.repo sync2013-05-141-0/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This helps to ensure that when a new system image is installed, old userdata policy isn't applied over the top of it. Bug: 8841348 Change-Id: I135af32250aa62979763e775842ce0af3c8b6f9f
* | | | am 683aa89b: Merge "Remove /system from the dirs to relabel." into jb-mr2-devgcondra@google.com2013-05-071-1/+0
|\ \ \ \ | |/ / / | | | | | | | | | | | | * commit '683aa89bfdf2439d1c5d9a4dc240d6a673678a98': Remove /system from the dirs to relabel.
| * | | Remove /system from the dirs to relabel.repo sync2013-05-071-1/+0
| | | | | | | | | | | | | | | | | | | | Bug: 8841348 Change-Id: Ia1545288e8a8184feffaaa6158faad62f95cbcce
* | | | am f69cc564: Merge "Update ueventd set the SELinux context on sysfs"Colin Cross2013-04-301-0/+9
|\ \ \ \ | | |/ / | |/| | | | | | | | | | * commit 'f69cc564f4129ad7f223bb7d83ebec9fe3438b62': Update ueventd set the SELinux context on sysfs
| * | | Merge "Update ueventd set the SELinux context on sysfs"Colin Cross2013-05-011-0/+9
| |\ \ \
| | * | | Update ueventd set the SELinux context on sysfsStephen Smalley2013-04-031-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change enables labeling of dynamically created sysfs nodes with specific SELinux security contexts. Change-Id: If8b8d66120453123c1371ce063b6f20e8b96b6ef Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
* | | | | am 032be7a4: Merge "Log an error if property pool is exhausted"Colin Cross2013-04-301-1/+5
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | * commit '032be7a4c5be8c015063084d162d1f394279aa3d': Log an error if property pool is exhausted
| * | | | Log an error if property pool is exhaustedJohan Redestig2013-04-291-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Failing to set properties due to an exhausted pool leads to difficult to debug problems. This change adds an error log to make the situation a bit easier to handle. Change-Id: Icc1d97a80882fb23e74428a0195f1d28dba68fa8
* | | | | am fee250d2: Reload policy after setting up the data partition.gcondra@google.com2013-04-304-3/+9
|\ \ \ \ \ | | |_|/ / | |/| | | | | | | | | | | | | * commit 'fee250d27a9c03af1ba439047b976d89563b1887': Reload policy after setting up the data partition.
| * | | | Reload policy after setting up the data partition.repo sync2013-04-304-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This forces a policy reload + fixcon to deal with dynamically delivered policy changing labels on device nodes. It's implemented as a new keyword in init. Bug: 8702843 Change-Id: I803cf1ecf6ff8318ce25dcc5cda4f292adc9738c
* | | | | am 538b5d4e: Merge "Add persistent property for SELinux enforcment status." ↵gcondra@google.com2013-04-261-0/+1
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | into jb-mr2-dev * commit '538b5d4e8e4c480b2120aa957fe3e11a2836a1b3': Add persistent property for SELinux enforcment status.
| * | | | Add persistent property for SELinux enforcment status.repo sync2013-04-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also adds triggers for going between enforcing and permissive status. Bug: 8702843 Change-Id: I841d80999b96acf6b6fd0a5408fb074952d6ae72
* | | | | am ebcf93e3: Add logic to fixup file contexts after a policy update.Geremy Condra2013-04-151-1/+6
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | * commit 'ebcf93e3bf92bf46c54c8e0f2ec8936bb2db6aea': Add logic to fixup file contexts after a policy update.
| * | | | Add logic to fixup file contexts after a policy update.Geremy Condra2013-04-151-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 8116902 (cherry picked from commit 47677a506febfe386d186f8f854d967f165a342f) Change-Id: I2a50f68a53aee2c94d03d3e5ced1ea36337fde33
* | | | | am 1a6d9ec2: Merge "fs_mgr: Capture the output of e2fsck and add to the ↵Ken Sumrall2013-04-151-0/+2
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | kernel log" into jb-mr2-dev * commit '1a6d9ec2af7b3151c64a167162c87d258d30735b': fs_mgr: Capture the output of e2fsck and add to the kernel log
| * | | | fs_mgr: Capture the output of e2fsck and add to the kernel logKen Sumrall2013-04-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the output of e2fsck is not saved, and we have no insight into how many errors e2fsck is finding and fixing. Using the new abbreviated logging feature in liblogwrap, up to the first 100 lines, and last 4K bytes of the output of e2fsck is captured by fs_mgr, and added to the kernel log. Usually, the filesystem will be clean, and this will only add a few lines to the kernel log on boot, but when things go wrong, it should save enough to indicate what the problem is, without potentially filling the kernel log with only e2fsck output if the filesystem is really corrupted. Change-Id: I9c264798e6fe721c8f818b5ce15d0975027ddbdd
* | | | | am 1615c09a: Merge "init: Fix potential null pointer issue"Colin Cross2013-04-051-9/+9
|\ \ \ \ \ | |/ / / / |/| / / / | |/ / / | | | | * commit '1615c09ac1065104f56ddc444f5467aff76c0daa': init: Fix potential null pointer issue
| * | | init: Fix potential null pointer issueHong-Mei Li2013-04-011-9/+9
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | With the old strdup() mechanism, it may return NULL if insufficient memory was available. So we check the return value or do not use strdup to avoid null pointer issue. Change-Id: Id684948d6cb6c2f06327f29a2ba692f9542fce80 Signed-off-by: Hong-Mei Li <a21834@motorola.com>
* | | Only handle keycodes when adb is enabled.Jeff Sharkey2013-04-041-6/+2
| | | | | | | | | | | | | | | | | | | | | This prevents accidental bugreports on userdebug/eng devices. Bug: 8541006 Change-Id: Iefd15826090fd91434403f197cfd166e64400224
* | | Apply the correct SELinux label for the properties workspace.Geremy Condra2013-04-031-0/+1
| | | | | | | | | | | | Change-Id: Ibb9c8044caa9d39ee6ec9fe06d54bb9dc4b56ff3
* | | am bed08333: am c0e1bc1c: Merge "Drop /data/system as a policy file location"Geremy Condra2013-03-271-1/+0
|\ \ \ | |/ / | | | | | | | | | * commit 'bed08333d921e97bc60b81c0f183816386709d79': Drop /data/system as a policy file location
| * | Drop /data/system as a policy file locationWilliam Roberts2013-03-261-1/+0
| | | | | | | | | | | | | | | | | | | | | /data/system is no longer used as a policy file location. Use /data/security instead. Change-Id: Ie77be9e25c67c8a2157c7b6c468f3215a49ead52