Please let me know where I'm doing wrong
file_contexts
/vendor/bin/mytest2.sh u:object_r:mytest2_exec:s0
mytest2.sh
#!/system/bin/sh
echo 'mytest2'
mytest2.te
type mytest2, domain;
type mytest2_exec, exec_type, vendor_file_type, file_type;
init_daemon_domain(mytest2)
allow mytest2 vendor_shell_exec:file rx_file_perms;
allow mytest2 vendor_toolbox_exec:file rx_file_perms;
imx8mm.mk file
PRODUCT_PACKAGES += \
$(IMX_DEVICE_PATH)/usb_control \
$(IMX_DEVICE_PATH)/hello_world
PRODUCT_COPY_FILES += \
$(IMX_DEVICE_PATH)/mytest2.sh:vendor/bin/mytest2.sh
init.rc
service mytest2 /vendor/bin/mytest2.sh
class main
user root
group root system
disabled
oneshot
on property:sys.boot_completed=1
start mytest2
logcat
/vendor/bin # logcat | grep mytest2
12-02 10:41:00.112 1903 1903 W ls : type=1400 audit(0.0:103): avc: denied { getattr } for path="/vendor/bin/mytest2.sh" dev="dm-7" ino=143073 scontext=u:r:shell:s0 tcontext=u:object_r:mytest2_exec:s0 tclass=file permissive=0