How to make native Unix/Linux daemon work on Android?

Started by fenix, December 06, 2013, 04:06:14 PM

Previous topic - Next topic

fenix

I'm searching the Internet for a serveral days with no result.

I have an application written in C++ that I compiled for Android OS. The app can also be run as daemon (by specifying --daemon option). When it's run as the regular executable it works fine, but when I try it to start as daemon it disappears after the fork() is performed I see it in logcat. It seems the OS just kills the process.

The questions are:

1. Whether it is possible to adapt Unix/Linux daemon code to work on Android? If yes how?
2. How to start it on boot? I suppose by init.rc, but how to edit it persistently?
3. If no. Is there any android specific approach to solve the task?

Please feel free to post links you think can be useful.
Thanx in advance.