title: python subprocess fails to find shell commands when started by systemctl
body: <p>When I launch a python application with systemctl, python subprocess fails when running standard shell commands such as tail, awk, etc.</p>
  
  <p>Code example:</p>
  
  <pre><code>import subprocess
  
  process = subprocess.Popen(['awk'], stdout=subprocess.PIPE)
  </code></pre>
  
  <p>save the above and run it via python app.py - no problems.</p>
  
  <p>Run that same command using systemctl and you will get the following error:</p>
  
  <pre><code>FileNotFoundError: [Errno 2] No such file or directory: 'awk': 'awk'
  </code></pre>
  
  <p>The same goes for all other commands that I know for a fact that I have installed - such as tail, sed, etc.</p>
  
  <p>I tried different ways of starting a subprocess such as <code>subprocess.run()</code>, <code>subprocess.call()</code>. I also tries using the <code>shell=True</code> and even the <code>executable='/bin/bash</code> argument.</p>
  
  <p>For the systemctl side, I tried running locally using <code>systemctl start service_name --user</code> and various combinations of the config - such as changing the process Type, running as root, different User, and Group.</p>
  
  <p>Here is an example of the config:</p>
  
  <pre><code>[Unit]
  Description={{ project_name }} Service
  After=network.target
  
  [Service]
  User={{ user }}
  Group={{ user_group }}
  
  Restart=always
  RestartSec=1s
  
  WorkingDirectory=/home/{{ user }}/{{ project_folder }}
  ExecStart=/home/{{ user }}/{{ project_folder }}/virtualenv/bin/python start.py
  
  [Install]
  WantedBy=multi-user.target
  </code></pre>