title: Golang exec: stat: no such file or directory after file has been moved there
body: <p>I have a script that I am using for deployment using the "os/exec" package. One of the commands that I use is as follows:</p>
  
  <pre><code>cpInit = exec.Command("cp", "initScripts/nginx", "/etc/init.d/nginx")
  </code></pre>
  
  <p>and another:</p>
  
  <pre><code>startNginx = exec.Command("/etc/init.d/nginx", "start")
  </code></pre>
  
  <p>Initially I ran the first command with <code>err := cpInit.Run()</code>, but later when I run the second command I get the error:</p>
  
  <pre><code>exec: "/etc/init.d/nginx": stat /etc/init.d/nginx: no such file or directory
  </code></pre>
  
  <p>But when the program exits <code>/etc/init.d/nginx</code> is there, so I thought maybe the first command didn't finished (even though <code>Run()</code> waits until the command returns). I changed <code>Run()</code> to <code>Start()</code> and <code>Wait()</code> only to get the same results. Can anyone tell me why the second command can't find that file?</p>