title: python script start on reboot failed
body: <p>I have a python script on a raspberry pi which i wanted to run on start up. I have created a start up file to run and it seems to startup my script but then the script fails. 
  I can run the script from the terminal when logged in and it works ok. 
  Below is what I get back from the failed start</p>
  
  <pre><code>● myscript.service
     Loaded: loaded (/lib/systemd/system/myscript.service; enabled)
     Active: failed (Result: exit-code) since Wed 2016-01-13 11:20:14 UTC; 1min 27s ago
    Process: 371 ExecStart=/usr/bin/python /home/pi/python/request.py (code=exited, status=1/FAILURE)
   Main PID: 371 (code=exited, status=1/FAILURE)
  
  Jan 13 11:20:14 raspberrypi python[371]: return session.request(method=method, url=url, **kwargs)
  Jan 13 11:20:14 raspberrypi python[371]: File "/usr/lib/python2.7/dist packages/requests/sessions.py", line 457, in request
  Jan 13 11:20:14 raspberrypi python[371]: resp = self.send(prep, **send_kwargs)
  Jan 13 11:20:14 raspberrypi python[371]: File "/usr/lib/python2.7/dist-packages/requests/sessions.py", line 569, in send
  Jan 13 11:20:14 raspberrypi python[371]: r = adapter.send(request, **kwargs)
  Jan 13 11:20:14 raspberrypi python[371]: File "/usr/lib/python2.7/dist-packages/requests/adapters.py", line 407, in send
  Jan 13 11:20:14 raspberrypi python[371]: raise ConnectionError(err, request=request)
  Jan 13 11:20:14 raspberrypi python[371]: requests.exceptions.ConnectionError: ('Connection aborted.', gaierror(-2, 'Name or service not known'))
  Jan 13 11:20:14 raspberrypi systemd[1]: myscript.service: main process exited, code=exited, status=1/FAILURE
  Jan 13 11:20:14 raspberrypi systemd[1]: Unit myscript.service entered failed state.
  </code></pre>
  
  <p>My python script uses request to connect to the intenet which is below</p>
  
  <pre><code>import requests
  import wiringpi2
  import time
  
  wiringpi2.wiringPiSetupGpio()
  wiringpi2.pinMode(17,1)
  
  wiringpi2.digitalWrite(17,1)
  
  def delay ():
          #wait here for a while
          counter = 0
          while counter &lt; 40:
                  counter += 1
                  #recheck web text file if now "o" then turn water off end delay
                  request = requests.get('http://stevesolarhome.com/WaterControl.txt')
                  #if still reading "1" then carry on with delay
                  if request.text == "1":
                          time.sleep(3)
                  elif request.text == "0":
                          counter = 401
          #delay timed out update web to turn water off
          #send update to text file
          payload = {'status':'0'}
          r = requests.get("http://stevesolarhome.com/water/water.php/get", params = payload)
          wiringpi2.digitalWrite(17,1)
          #digitalWrite turn water off
  
  while 1:
          request = requests.get('http://stevesolarhome.com/WaterControl.txt')
          if request.text == "1":
                  wiringpi2.digitalWrite(17,0)
                  delay ()
  </code></pre>
  
  <p>Can anyone help. Do you need the start up script. I was following the below tutorial for this 
  <a href="http://www.raspberrypi-spy.co.uk/2015/10/how-to-autorun-a-python-script-on-boot-using-systemd/" rel="nofollow">http://www.raspberrypi-spy.co.uk/2015/10/how-to-autorun-a-python-script-on-boot-using-systemd/</a></p>