# Using the service module to handle uncooperative services

**URL:** <https://forum.ansible.com/t/using-the-service-module-to-handle-uncooperative-services/12237>\
**Category:** Ansible Project\
**Created:** [January 22, 2013, 10:23pm UTC](https://forum.ansible.com/t/using-the-service-module-to-handle-uncooperative-services/12237 "2013-01-22T22:23:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Hokka\_Zakriss](https://avatars.discourse-cdn.com/v4/letter/d/f05b48/32.png) [@Daniel\_Hokka\_Zakriss](https://forum.ansible.com/u/Daniel_Hokka_Zakriss)\
**Post date:** [January 22, 2013, 10:23pm UTC](https://forum.ansible.com/t/using-the-service-module-to-handle-uncooperative-services/12237/1 "2013-01-22T22:23:38Z")

</div>

Hello everyone,

I have made some changes to the service module to daemonize for all the  
broken daemons out there. So if you have previously had services that you  
were unable to start with it, making ansible seemingly hang indefinitely,  
please give this a try and see if things now work as expected. Please let us  
know either way!

Daniel

---

<div class="post-metadata">

**Author:** ![lisa](https://avatars.discourse-cdn.com/v4/letter/l/f08c70/32.png) [@lisa](https://forum.ansible.com/u/lisa)\
**Post date:** [February 5, 2013, 9:00pm UTC](https://forum.ansible.com/t/using-the-service-module-to-handle-uncooperative-services/12237/2 "2013-02-05T21:00:23Z")

</div>

Hi Daniel,

I just upgraded to using Ansible branch release1.0 from 0.9 and ran into a problem with the service module on a Fedora 15 system. When I change “daemonize=True” to “daemonize=False” in LinuxService.service\_control() the module works for my use case again as it was before the upgrade.

More specifically, it seems that the stdout from the command (“/sbin/service fooservice status”) is being lost when daemonized. With daemonize=True, this function returns (1, “”, “”) and with daemonize=False it returns (1, “fooservice is not running.\n”, “”).

Thanks,  
Lisa

---

<div class="post-metadata">

**Author:** ![Mark\_Theunissen](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@Mark\_Theunissen](https://forum.ansible.com/u/Mark_Theunissen)\
**Post date:** [February 6, 2013, 8:34pm UTC](https://forum.ansible.com/t/using-the-service-module-to-handle-uncooperative-services/12237/3 "2013-02-06T20:34:16Z")

</div>

Lisa:

This is now fixed in devel. Daniel, bcoca, and I worked on it this morning.

- Mark

---

<div class="post-metadata">

**Author:** ![lisa](https://avatars.discourse-cdn.com/v4/letter/l/f08c70/32.png) [@lisa](https://forum.ansible.com/u/lisa)\
**Post date:** [February 6, 2013, 11:19pm UTC](https://forum.ansible.com/t/using-the-service-module-to-handle-uncooperative-services/12237/4 "2013-02-06T23:19:58Z")

</div>

Works for me, thanks!

Lisa
