Post Reply

init.rc to launch a script at boot

OP l_electron

5th July 2014, 06:26 PM   |  #1  
OP Junior Member
Thanks Meter: 0
2 posts
Join Date:Joined: Jul 2014
I'm trying to get a script to launch. I've done quite a bit of research; nothing I've found has proved very useful. I'm trying to do this on a Galaxy S3 with Cyanogenmod 10.2 Stable. Since it looks like this is a neglected issue on XDA, I'll also reference the other posts which I've read.

Running it as root at startup with SManager works, but I would really prefer to bypass a 3rd-party app.

My script doesn't seem to be loading at boot; it should create a PID file in my /sdcard folder, but it doesn't. Without knowing the PID, I have no way of verifying whether or not it's even running.
(while [it's a never-ending loop] [stuff]; busybox sleep 900s...done) & echo $! > /sdcard/ &
I've tried a couple different ways of calling this script from init.rc:
on boot
     sh /system/bin/
service myscript(*I also tried "myscript_boot") /system/bin/
     user root (*also tried it without the user command)
     oneshot (*and without oneshot)
I also find it strange that my changes to init.rc are persistent after reboot since many, many articles suggest that it should be reset after reboot (I've noticed that many of these articles date back to ~2010).

Since I can't find any conclusive documentation on this issue. I hope someone here can shed some insight.

# Editing init.rc
# Tried following this article to edit/flash the boot image, but I don't have "/proc/mtd"
# A neglected post very similar to mine
# Another neglected post which addresses this issue
5th July 2014, 06:32 PM   |  #2  
OP Junior Member
Thanks Meter: 0
2 posts
Join Date:Joined: Jul 2014
One more thing. My script runs fine if I issue the command in the Terminal emulator, adb shell, and, as mentioned earlier, if launched with SManager. It's only init.rc that's giving me issues.
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Top Threads in Android Q&A, Help & Troubleshooting by ThreadRank