title: How to run a service in init (Android 8.1)
body: <p>I want to run the service through Init. (Android 8.1, sepolicy=permissive)</p>
  
  <p>The service executes the script file, and the script file is as follows.</p>
  
  <pre><code>tcc898x:/ # cat /system/bin/tcc_dxb_service
  #!/system/bin/sh
  echo ----------------
  echo RICHGOLD.
  echo ----------------
  </code></pre>
  
  <p>Service execution in init proceeds as follows.</p>
  
  <pre><code>tcc898x:/ # cat init.tcc898x.rc
  (...)
  on boot
      (...)
      start tcc_dxb_service
  (...)
  service tcc_dxb_service /system/bin/tcc_dxb_service
      class main
      user root
      u:object_r:tcc_dxb_service_exec:s0
  </code></pre>
  
  <p>And to add domain, sepolicy file is added as below.</p>
  
  <pre><code># cat (Android 8.1 SDK)/device/(vendor)/(product)/sepolicy/tcc_dxb_service.te
  type tcc_dxb_service, domain;
  type tcc_dxb_service_exec, exec_type, system_file_type, file_type;
  init_daemon_domain(tcc_dxb_service)
  </code></pre>
  
  <p>When the tcc_dxb_service service is executed, the following output is displayed.</p>
  
  <pre><code>tcc898x:/ # start tcc_dxb_service
  init: could not get context while starting 'tcc_dxb_service'
  </code></pre>
  
  <p><strong>Please tell me how to register the domain in Sepolicy to run the service.</strong></p>
  
  <p>Thanks. </p>