I am trying to run a shell script, which copies a file to a specific location, on phone power up and I added the following to my init.rc file:
service test_copy /system/bin/sh /system/bin/test_copy.sh
class pre-zygote_services
oneshot
user system
group system
When the service name (test_copy)
is same as the script name, test_copy
in this case, it doesn't execute the script but if I change the service name to a different one, like start_test_copy
, it works. I am just eager to know the reason on why when service name is same as script name it doesn't work or am I wrong?
Try this one in your init.rc:
service test_copy /system/bin/test_copy.sh
user root
oneshot
Your test_copy.sh script must begin with:
#!/system/bin/sh
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With