title: script run from ansible returning multiple 'No such file or directory', runs fine manually
body: <p>I'm experience this odd behavior, that I have an inkling of what might be causing it, but not sure how to resolve.
  Hoping someone with more experience understands/sees something I'm not.
  I'm running a script from an ansible play(I've put it down below). This script starts up other things like dameons, that will run other scripts at certain times. These have worked well for years on linux boxes. Now trying to run them on the cloud, so I'm using ansible to start the initial script.
  But I'm running into a problem. These scripts are logging a lot of error messages like:</p>
  <blockquote>
  <p>shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory</p>
  </blockquote>
  <p>It should be noted that the dameons do get brought up, it's only when they start trying to actually execute binaries or access directories do problems arise. These binaries/directories I can also confirm do in fact exist, and use absolute paths to access them.
  So to debug such a problem, I take the one command I'm trying to run via ansible, and run it manual (same permissions/user). It works fine, no problem.
  It should be noted I've done this manual with absolute and relative paths. Both will start the dameons, and everything works as it should.
  I've looked at other stackoverflow links like <a href="https://stackoverflow.com/questions/29396928/shell-init-error-retrieving-current-directory-getcwd-the-usual-fixes-do-not/41704858">this one</a>, and saw that if you're in another shell it won't be able to find these directories, and you have to use a cd hack to get back to where you want.
  Which I'd like to avoid using.</p>
  <p>I find it hard to believe that ansible is causing this, as I would have thought I would have came across a post/article mentioning this. Or maybe it has nothing to do with the other link.</p>
  <p>Any tips for debugging/advice is appreciated. Thanks.</p>
  <pre><code>- name: Start Daemons.
    become: yes
    become_user: &quot;jr&quot;
    command: /home/&lt;absolute_path_to_dameons&gt;/sbin/start_daemons.sh
  </code></pre>