# "Failed to find required executable git" when using launch daemon to run ansible-pull

**URL:** <https://forum.ansible.com/t/failed-to-find-required-executable-git-when-using-launch-daemon-to-run-ansible-pull/19123>\
**Category:** Ansible Project\
**Created:** [August 27, 2015, 9:58am UTC](https://forum.ansible.com/t/failed-to-find-required-executable-git-when-using-launch-daemon-to-run-ansible-pull/19123 "2015-08-27T09:58:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ye\_Na\_Rhee](https://avatars.discourse-cdn.com/v4/letter/y/d26b3c/32.png) [@Ye\_Na\_Rhee](https://forum.ansible.com/u/Ye_Na_Rhee)\
**Post date:** [August 27, 2015, 9:58am UTC](https://forum.ansible.com/t/failed-to-find-required-executable-git-when-using-launch-daemon-to-run-ansible-pull/19123/1 "2015-08-27T09:58:00Z")

</div>

I’m getting these errors when I set launch daemon to run ansible-pull, and it works well when I run the script directly in terminal.

Starting ansible-pull at 2015-08-27 11:46:47  
localhost | FAILED \>\> {  
“failed”: true,  
“msg”: “Failed to find required executable git”  
}

The launchd file looks like this:

\<?xml version="1.0" encoding="UTF-8"?\> Label com.myprogram.ansiblepull ProgramArguments {{ workdir }}/ansible-pull.sh StartInterval 600

RunAtLoad

StandardOutPath  
/var/ansible/log/ansiblepull.out  
StandardErrorPath  
/var/ansible/log/ansiblepull.err

The path to git is /usr/local/bin/git.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![Ye\_Na\_Rhee](https://avatars.discourse-cdn.com/v4/letter/y/d26b3c/32.png) [@Ye\_Na\_Rhee](https://forum.ansible.com/u/Ye_Na_Rhee)\
**Post date:** [August 27, 2015, 10:19am UTC](https://forum.ansible.com/t/failed-to-find-required-executable-git-when-using-launch-daemon-to-run-ansible-pull/19123/2 "2015-08-27T10:19:33Z")

</div>

I solved it by including the PATH variable in the launchd file:

EnvironmentVariables  
  
PATH  
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
