Thanks everybody,
What I did just now is adding a new "on" section like this:
on myservice
class_start myservice
service myservice /system/bin/myservice
class myservice
user root
group root
oneshot
and adding a line in init.c like:
action_for_each_trigger("myservice", action_add_queue_tail);
before the similar line starting "early_boot".
In this way, among so many system boot, sometimes myservice can boot
firstly, sometimes can't.
I've tried to add a "class_start myservice" or "start myservice" in "on
boot" before "class_start core" and "class_start main", but it worked not
so well. It booted firstly only few times.
And I used to copy the code of myservice into init.c, the compilation works
fine. but the android system can't boot. I debuged it and found that the
fopen and fgets result in the boot failure.
So is there any way to make sure that myservice is booted right before
other services every time?
2013/6/14 Pratik Prajapati <[email protected]>
> You might need to start your service "on boot"
> --
> Regards,
> Pratik
>
>
> On Wed, Jun 12, 2013 at 11:34 PM, 董钰 <[email protected]> wrote:
>
>> Thank you for reply. My service is written in native c ,and I've already
>> can boot my service through adding code in init.rc. But I can't make it the
>> first service to boot.
>>
>>
>> 2013/6/13 Pratik Prajapati <[email protected]>
>>
>>> As far as i know you can not start your java service on first of all
>>> other services. Technically you can start it from init.rc but you can not
>>> get any other system service object in your service. you can not even get
>>> system context, nothing will work, your service will crash. But if you want
>>> to run some native code you can do it. look into init.rc where vold starts.
>>>
>>>
>>> --
>>> Regards,
>>> Pratik
>>>
>>>
>>> On Wed, Jun 12, 2013 at 8:53 PM, <[email protected]> wrote:
>>>
>>>> Any suggestions would be greatly appreciated.
>>>>
>>>>
>>>> On Thursday, June 13, 2013 11:52:19 AM UTC+8, [email protected] wrote:
>>>>>
>>>>> I want to boot my own service right after all ".img" file were mounted
>>>>> and before any other service was going to boot.
>>>>>
>>>> --
>>>> --
>>>> unsubscribe: [email protected]
>>>> website: http://groups.google.com/group/android-kernel
>>>> ---
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Android Linux Kernel Development" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>>
>>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>>
>>>>
>>>>
>>>
>>> --
>>> --
>>> unsubscribe: [email protected]
>>> website: http://groups.google.com/group/android-kernel
>>> ---
>>> You received this message because you are subscribed to a topic in the
>>> Google Groups "Android Linux Kernel Development" group.
>>> To unsubscribe from this topic, visit
>>> https://groups.google.com/d/topic/android-kernel/obskHZkaKBI/unsubscribe?hl=en
>>> .
>>> To unsubscribe from this group and all its topics, send an email to
>>> [email protected].
>>>
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>
>> --
>> --
>> unsubscribe: [email protected]
>> website: http://groups.google.com/group/android-kernel
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "Android Linux Kernel Development" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected].
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
> --
> --
> unsubscribe: [email protected]
> website: http://groups.google.com/group/android-kernel
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "Android Linux Kernel Development" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/android-kernel/obskHZkaKBI/unsubscribe.
>
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>
--
--
unsubscribe: [email protected]
website: http://groups.google.com/group/android-kernel
---
You received this message because you are subscribed to the Google Groups
"Android Linux Kernel Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.