title: Python daemon and systemd service
body: <p>I have a simple Python script working as a daemon. I am trying to create systemd script to be able to start this script during startup.</p>
  
  <p>Current systemd script:</p>
  
  <pre><code>[Unit]
  Description=Text
  After=syslog.target
  
  [Service]
  Type=forking
  User=node
  Group=node
  WorkingDirectory=/home/node/Node/
  PIDFile=/var/run/zebra.pid
  ExecStart=/home/node/Node/node.py
  
  [Install]
  WantedBy=multi-user.target
  </code></pre>
  
  <p>node.py:</p>
  
  <pre><code>if __name__ == '__main__':
      with daemon.DaemonContext():
          check = Node()
          check.run()
  </code></pre>
  
  <p><code>run</code> contains <code>while True</code> loop.</p>
  
  <p>I try to run this service with <code>systemctl start zebra-node.service</code>. Unfortunately service never finished stating sequence - I have to press Ctrl+C.
  Script is running, but status is activating and after a while it change to deactivating.
  Now I am using python-daemon (but before I tried without it and the symptoms were similar).</p>
  
  <p>Should I implement some additional features to my script or is systemd file incorrect?</p>