title: systemd job failing No such file or Directory
body: <p>have been trying to follow this script to start airflow</p>
  
  <p><a href="https://linuxconfig.org/how-to-automatically-execute-shell-script-at-startup-boot-on-systemd-linux" rel="nofollow noreferrer">https://linuxconfig.org/how-to-automatically-execute-shell-script-at-startup-boot-on-systemd-linux</a></p>
  
  <p>So i have the following sh file in /usr/local/bin/airflow-start-all.sh</p>
  
  <pre><code>#!/bin/bash
  echo "starting up postgres service"
  export AIRFLOW_HOME=~/airflow
  sudo service postgresql start
  echo "sleeping"
  sleep 15
  echo "initiating database"
  airflow initdb
  echo "sleeping"
  sleep 15
  gnome-terminal -e /home/ubuntu/Source/Bash/airflow-start-webserver.sh
  sleep 15
  echo "starting rabbitmq service"
  sudo service rabbitmq-server start
  sleep 15
  gnome-terminal -e /home/ubuntu/Source/Bash/airflow-start-scheduler.sh
  sleep 15
  gnome-terminal -e /home/ubuntu/Source/Bash/airflow-start-worker.sh
  </code></pre>
  
  <p>and the following file in /etc/systemd/system/airflow-start-service.service</p>
  
  <pre><code>[Unit]
  Description=My last command
  After=default.target
  
  [Service]
  ExecStart=/usr/local/bin/airflow-start-all.sh
  
  [Install]
  WantedBy=default.target
  </code></pre>
  
  <p>I have run</p>
  
  <pre><code>sudo chmod 744 /usr/local/bin/airflow-start-all.sh
  </code></pre>
  
  <p>and</p>
  
  <pre><code>sudo chmod 664 /etc/systemd/system/airflow-service-start.service
  </code></pre>
  
  <p>and also</p>
  
  <pre><code>systemctl daemon-reload
  systemctl enable disk-space-check.service
  </code></pre>
  
  <p>And it doesnt seem to start the services on startup - all I get is:</p>
  
  <pre><code>● airflow-service-start.service - My last command
     Loaded: loaded (/etc/systemd/system/airflow-service-start.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Wed 2018-05-02 00:23:00 UTC; 1h 21min ago
    Process: 1587 ExecStart=/usr/local/bin/airflow-start-all.sh (code=exited, status=1/FAILURE)
   Main PID: 1587 (code=exited, status=1/FAILURE)
  
  May 02 00:22:30 sudo[1658]: pam_unix(sudo:session): session closed for user root
  May 02 00:22:45 airflow-start-all.sh[1587]: Failed to connect to Mir: Failed to connect to server socket: No such file or directory
  May 02 00:22:45 airflow-start-all.sh[1587]: Unable to init server: Could not connect: Connection refused
  May 02 00:22:45  airflow-start-all.sh[1587]: Failed to parse arguments: Cannot open display:
  May 02 00:23:00 airflow-start-all.sh[1587]: Failed to connect to Mir: Failed to connect to server socket: No such file or directory
  May 02 00:23:00 airflow-start-all.sh[1587]: Unable to init server: Could not connect: Connection refused
  May 02 00:23:00 airflow-start-all.sh[1587]: Failed to parse arguments: Cannot open display:
  May 02 00:23:00  systemd[1]: airflow-service-start.service: Main process exited, code=exited, status=1/FAILURE
  May 02 00:23:00  systemd[1]: airflow-service-start.service: Unit entered failed state.
  May 02 00:23:00  systemd[1]: airflow-service-start.service: Failed with result 'exit-code'.
  </code></pre>
  
  <p>Any idea where I have gone wrong?</p>
  
  <p>Thanks,
  Tim</p>