Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.00 KB | None | 0 0
  1. #/etc/init/custom.rc
  2.  
  3. # define service, use executable here if script not needed
  4. service custom /system/bin/custom.sh
  5.  
  6. # don't start unless explicitly asked to
  7. disabled
  8.  
  9. # run with unrestricted SELinux context to avoid avc denials
  10. # can also use "u:r:su:s0" on userdebug / eng builds if no Magisk
  11. # it's required if SELinux is enforcing and service needs access
  12. # to some system resources not allowed by default sepolicy
  13. # seclabel u:r:magisk:s0
  14. seclabel u:r:su:s0
  15.  
  16. # start the service when boot is completed
  17. on property:sys.boot_completed=1
  18. start executable
  19.  
  20. #!/system/bin/sh
  21.  
  22. # execute the binary, should run in foreground, otherwise get in loop
  23. echo "$(date): Starting program..."
  24. exec /system/bin/executable
  25.  
  26. # Give rights to the executable
  27. chown 0.0 /system/bin/executable
  28. chmod 554 /system/bin/executable
  29. chcon u:object_r:system_file:s0 /system/bin/executable
  30.  
  31. # Give rights to the custom.sh
  32. chown 0.0 /system/bin/custom.sh
  33. chmod 554 /system/bin/custom.sh
  34. chcon u:object_r:system_file:s0 /system/bin/custom.sh
  35.  
  36. # Give rights to the custom.rc
  37. chown 0.0 /etc/init/custom.rc
  38. chmod 644 /etc/init/custom.rc
  39. chcon u:object_r:system_file:s0 /etc/init/custom.rc
  40.  
  41. [ 55.829099 / 06-09 23:51:09.279][0] init: cannot execve('/system/bin/custom.sh'): Permission denied
  42. [ 55.850172 / 06-09 23:51:09.309][6] init: Service 'custom' (pid 7729)
  43. [ 55.850224 / 06-09 23:51:09.309][6] init: Service 'custom' (pid 7729) exited with status 127
  44. [ 55.850243 / 06-09 23:51:09.309][6] init: Sending signal 9 to service 'custom' (pid 7729) process group...
  45. [ 60.830224 / 06-09 23:51:14.289][6] init: starting service 'custom'...
  46. [ 60.832073 / 06-09 23:51:14.289][1] init: cannot execve('/system/bin/custom.sh'): Permission denied
  47. [ 60.832153 / 06-09 23:51:14.289][3] audit: type=1400 audit(1560142274.289:131): avc: denied { transition } for pid=8035 comm="init" path="/system/bin/custom.sh" dev="sda24" ino=8146 scontext=u:r:init:s0 tcontext=u:r:su:s0 tclass=process permissive=0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement