title: systemd service not works in docker
body: <p>my environment is under docker image(ubuntu 20.04), and <strong>i want to use systemd to start my service after every time i start mydocker</strong>, i have my own .service file here:</p>
  <p>/etc/systemd/system/my.service:</p>
  <pre><code>[Unit]
  Description=my test
  Documentation=man:test auto(8) man:test_config(5)
  
  [Service]
  ExecStart=/root/test.sh
  Type=oneshot
  
  [Install]
  WantedBy=multi-user.target
  </code></pre>
  <p>/root/test.sh have been chmod 777:</p>
  <pre><code>#!/bin/bash
  
  echo &quot;hello~&quot;  &gt; /usr/local/test.log
  exit 0
  </code></pre>
  <p>and I did follows operation:</p>
  <pre><code>systemctl enable my.service
  docker stop mydocker
  docker start mydocker
  docker exec -it mydocker bash
  </code></pre>
  <p>but after I start mydocker, I didn't see /root/test.sh executed, and i check service status like this:</p>
  <pre><code>my.service - my test auto
      Loaded: loaded (/etc/systemd/system/my.service, enabled)
      Active: inactive (dead)
  </code></pre>
  <p>manually trigger service is okay:</p>
  <pre><code>root@:/# systemctl start my.service
  root@:/# cat /usr/local/test.log 
  hello~
  
  </code></pre>
  <p>did I omit something? or systemd could not work well in docker?</p>
  <p>thanks.</p>