title: bash script can't find source file in script running in systemd
body: <p>I have set up a systemd.service that starts a bash script when the system boots. The script starts, but it seems that it cannot find the referenced source files but when i start the same script from the terminal i works fine. Al scripts are in one and the same directory.</p>
  <p>Anyone have any suggestions to fix this?</p>
  <p>systemd.service file:</p>
  <pre><code>[Unit]
  Description=RIB
  After=network-online.target
  
  [Service]
  Type=simple
  ExecStart=/home/user/release/.scripts/start-script.sh start
  Restart=on-failure
  
  [Install]
  WantedBy=multi-user.target
  </code></pre>
  <p>part of the start-script.sh</p>
  <pre><code>#!/bin/bash
  
  source config.sh
  source function.sh
  
  
  check_connection #function
  
  # GET LOCATION IN .JSON FILE
  get_location #function
  if [[ $? -ne 0 ]]
  then
      printf &quot;%s\n&quot;&quot;Can't get location\n\n&quot;
  else
      printf &quot;%s\n&quot;&quot;Location successfully retrieved\n\n&quot;
  fi
  </code></pre>
  <p>source config.sh:</p>
  <pre><code>version=&quot;2021.01.25&quot;
  date=`date '+%Y-%m-%d %H:%M:%S'`
  time=`date '+%H:%M:%S'`
  temp_path=&quot;/home/$USER/temp&quot;
  release_path=&quot;/home/$USER/release&quot;
  info_path=&quot;$release_path/to/info&quot;
  content_path=&quot;$release_path/to/content&quot;
  ftp_url=&quot;ftp.test.com&quot;
  </code></pre>
  <p>source function.sh:</p>
  <pre><code>function check_connection ()
  {
      printf &quot;%s\n&quot;&quot;${Green}Check connection with $ftp_url.${Color_Off}\n\n&quot;
      while ! timeout 0.2 ping -c 1 -n $ftp_url &amp;&gt; /dev/null
      do
      printf &quot;%s\n&quot;&quot;${Green}RIB cannot reach $ftp_url, check WIFI connection.${Color_Off}\n\n&quot;
      sleep 5
      done
      printf &quot;%s\n&quot;&quot;${Green}RIB can reach $ftp_url.${Color_Off}\n\n&quot;
  }
  
  </code></pre>