# Ansible Inventory and daemonize

**URL:** <https://forum.ansible.com/t/ansible-inventory-and-daemonize/17812>\
**Category:** Ansible Developer\
**Created:** [March 23, 2015, 2:49pm UTC](https://forum.ansible.com/t/ansible-inventory-and-daemonize/17812 "2015-03-23T14:49:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adham\_H](https://avatars.discourse-cdn.com/v4/letter/a/b2d939/32.png) [@Adham\_H](https://forum.ansible.com/u/Adham_H)\
**Post date:** [March 23, 2015, 2:49pm UTC](https://forum.ansible.com/t/ansible-inventory-and-daemonize/17812/1 "2015-03-23T14:49:21Z")

</div>

Hi,  
I created an ansible inventory script for joyent. The script does smart caching where it can serve from cache and create a daemon thats does an API to update cache.

The script uses “daemonize” to create a background session and detaches the main process. It works perfect if invoked from command line but when invoked “ansible -i ./joyent.py --list-hosts all” it waits for the damon process somehow.

[https://github.com/ahelal/ansible-joyent-inventory/blob/master/joyent.py](https://github.com/ahelal/ansible-joyent-inventory/blob/master/joyent.py)

Not sure where to start any ideas

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [March 23, 2015, 3:43pm UTC](https://forum.ansible.com/t/ansible-inventory-and-daemonize/17812/2 "2015-03-23T15:43:30Z")

</div>

does your daemon detach from the tty?
