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?