Unable to execute daemon on boot within init.rc
<p>I have created a daemon but is unable to run it in my Nexus 5 running on Marshmallow.</p>

<p>Following is the code edited in init.rc</p>

<pre><code>on init
    chmod 777 /sbin/check_usb
    chown root root /sbin/check_usb

service disableadb /sbin/check_usb
    class main 
    seclabel u:r:disableadb:s0
</code></pre>

<p>Following is my entry edited within init.usb.rc such that when an adb connection is detected , my daemon will be executed</p>

<pre><code>on property:sys.usb.config=accessory,adb &amp;&amp; property:sys.usb.configfs=0
start disableadb
</code></pre>

<p>I have inserted my check_usb program under /sbin/system and granted chmod 777 access to it.</p>

<p>However I notice that in the dmesg | grep disableadb output, my daemon was unable to be executed with the error as follows:</p>

<pre><code>init : cannot setexeccon ('u:r:disableadb:s0') Invalid argument
</code></pre>