title: Systemd script fail
body: <p>I want to run a script at system startup in a Debian 9 box. My script works when run standalone, but fails under systemd. </p>
  
  <p>My script just copies a backup file from a remote server to the local machine:</p>
  
  <pre><code>#!/bin/sh
  set -e
  
  /usr/bin/sshpass -p "PASSWORD" /usr/bin/scp -p USER@10.0.0.2:ORIGINPATH/backupserver.zip DESTINATIONPATH/backupserver/
  </code></pre>
  
  <p>Just for privacy I replaced password, user, and paths above.</p>
  
  <p>I wrote the following systemd service unit:</p>
  
  <pre><code>[Unit]
  Description=backup script
  
  [Service]
  Type=oneshot
  ExecStart=PATH/backup.sh
  
  [Install]
  WantedBy=default.target
  </code></pre>
  
  <p>Then I set permissions for the script:</p>
  
  <pre><code>chmod 744 PATH/backup.sh
  </code></pre>
  
  <p>And installed the service:</p>
  
  <pre><code>chmod 664 /etc/systemd/system/backup.service
  systemctl daemon-reload
  systemctl enable backup.service
  </code></pre>
  
  <p>When I reboot the script fails:</p>
  
  <pre><code>● backup.service - backup script
     Loaded: loaded (/etc/systemd/system/backup.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Sat 2017-05-13 13:39:54 -03; 47min ago
   Main PID: 591 (code=exited, status=1/FAILURE)
  </code></pre>
  
  <p>Result of journalctl -xe:</p>
  
  <pre><code>mai 16 23:34:27 rodrigo-acer systemd[1]: backup.service: Main process exited, code=exited, status=6/NOTCONFIGURED
  mai 16 23:34:27 rodrigo-acer systemd[1]: Failed to start backup script.
  mai 16 23:34:27 rodrigo-acer systemd[1]: backup.service: Unit entered failed state.
  mai 16 23:34:27 rodrigo-acer systemd[1]: backup.service: Failed with result 'exit-code'.
  </code></pre>
  
  <p>What could be wrong?</p>