Linux - MobileThis forum is for the discussion of all topics relating to Mobile Linux. This includes Android, Tizen, Sailfish OS, Replicant, Ubuntu Touch, webOS, and other similar projects and products.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am working on an Android phone which has Linux Kernel 2.6.35.11. When I generated the boot chart, I can see there are 2 /init processes. One is in sleep almost all the time and the other is doing a lot of processing and was created after around 5 seconds. Also when I plugged in the phone to the PC and ran "adb shell", I saw 3 /init processes!! 2nd one's parent was the first one and the third one's parent was the second /init. All the other major threads were spawned by the third /init process!
Can anyone throw some hints on why are there multiple /init processes??
Click here to see the post LQ members have rated as the most helpful post in this thread.
Hi All,
I found the cause for the above stated multiple /init processes problem. In Android, exec command is implemented a combination of fork()+execv(). So while running exec commands from init.rc, /init process first forks itself and then the resulting child execv()s a new binary. If this execv() fails ( which was the case with me ) and there's is no error checking, then there shall remain 2 processes with the same name ( in this case, 2 /init processes ). We added _exit() for the failed execv() case so that the failed child terminates immediately.
Welcome to LQ. I think you're already becoming a valuable contributor here.
Thanks for taking the time to post back your solution.
Thanks for taking the time to mark this "[SOLVED]".
Your "[Android]" tag in the title is a good idea, more folks should use it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.