title: How to debug a failed systemctl service (code=exited, status=217/USER)?
body: <p>I'm trying to add my first service on <code>rhel7</code> (which resides in AWS/EC2), but - the service is not configured correctly - as I get:</p>
  <pre><code>[ec2-user@ip-172-30-1-96 ~]$ systemctl status clouddirectd.service -l
  ● clouddirectd.service - CloudDirect Daemon
     Loaded: loaded (/usr/lib/systemd/system/clouddirectd.service; enabled; vendor preset: disabled)
     Active: activating (auto-restart) (Result: exit-code) since Tue 2018-01-09 16:09:42 EST; 8s ago
   Main PID: 10064 (code=exited, status=217/USER)
  
  Jan 09 16:09:42 ip-172-30-1-96.us-west-1.compute.internal systemd[1]: clouddirectd.service: main process exited, code=exited, status=217/USER
  Jan 09 16:09:42 ip-172-30-1-96.us-west-1.compute.internal systemd[1]: Unit clouddirectd.service entered failed state.
  Jan 09 16:09:42 ip-172-30-1-96.us-west-1.compute.internal systemd[1]: clouddirectd.service failed.
  </code></pre>
  <p>Also:</p>
  <pre><code>[ec2-user@ip-172-30-1-96 ~]$ systemctl is-active clouddirectd
  activating
  [ec2-user@ip-172-30-1-96 ~]$ sudo systemctl list-units --type service --all | grep clouddirectd
    clouddirectd.service                                  loaded    activating auto-restart CloudDirect Daemon
  </code></pre>
  <p>And my unit file is:</p>
  <pre><code>[ec2-user@ip-172-30-1-96 ~]$ cat /usr/lib/systemd/system/clouddirectd.service
  [Unit]
  Description=CloudDirect Daemon
  After=network.target
  
  [Service]
  Environment=AWS_SHARED_CREDENTIALS_FILE=/etc/sonar/.aws/credentials
  #ExecStart=/usr/lib/sonar/clouddirect/virtualenv/bin/python /usr/bin/sonar/clouddirectd -c /etc/sonar/clouddirect/clouddirectd.conf
  ExecStart=/usr/lib/sonar/clouddirect/virtualenv/bin/python /usr/bin/clouddirect -c /etc/sonar/clouddirect.conf
  # @PERM@ allow group write permission on newly created files
  UMask=0007
  #User=clouddirectd
  User=clouddirect
  Group=sonar
  KillSignal=SIGINT
  TimeoutStopSec=60min
  Restart=always
  RestartSec=5
  
  [Install]
  WantedBy=multi-user.target
  </code></pre>
  <p><strong>Can you suggest how to debug this systemctl service so it won't keep dying and auto restarting?</strong></p>