title: on boot my android phone init .sh script run but not fully
body: <p>Stack!</p>
  
  <p>This my first question on this, so don't be too hard with me.</p>
  
  <p>I want to run my own .sh script file on boot my android. To get this I rebuild kernel image and before that I add to init.rc file my own service which start after boot complete trigger:</p>
  
  <pre><code>on property:dev.bootcomplete=1
      start fota-snoop
      start fota-trigger
      start startup-prober
      start fairnet
  </code></pre>
  
  <p>the service itself:</p>
  
  <pre><code>service fairnet /system/bin/sh /system/etc/init.fairnet.sh
      user root
      group root
      disabled
      oneshot
  </code></pre>
  
  <p>permissions of /system/etc/init.fairnet.sh is set 644 like others init .sh scripts, and owner is root:root :</p>
  
  <pre><code>-rw-r--r-- root     root          280 2018-01-09 01:03 init.fairnet.sh
  </code></pre>
  
  <p>init.fairnet.sh:</p>
  
  <pre><code>#!/system/bin/sh
  
  insmod /system/lib/modules/xt_HL.ko
  lsmod &gt; /system/etc/curlsmod
  /system/bin/iptables -t mangle -L &gt; /system/etc/preiptables
  /system/bin/iptables -t mangle -A POSTROUTING -o rmnet+ -j TTL --ttl-set 64
  /system/bin/iptables -t mangle -L &gt; /system/etc/postiptables
  </code></pre>
  
  <p>the most funny thing is command of load kernel module works fine, on boot too, but the other strings don't works: output files didn't exist, rule for iptables didn't add. I can't understand why insmod works and other commands don't.</p>
  
  <p>Thanks for reading and sorry for my terrible English.</p>