# Right way to wait for service start

**URL:** <https://forum.ansible.com/t/right-way-to-wait-for-service-start/23176>\
**Category:** Ansible Project\
**Created:** [December 6, 2016, 4:11am UTC](https://forum.ansible.com/t/right-way-to-wait-for-service-start/23176 "2016-12-06T04:11:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mumshad\_Mannambeth](https://avatars.discourse-cdn.com/v4/letter/m/3da27b/32.png) [@Mumshad\_Mannambeth](https://forum.ansible.com/u/Mumshad_Mannambeth)\
**Post date:** [December 6, 2016, 4:11am UTC](https://forum.ansible.com/t/right-way-to-wait-for-service-start/23176/1 "2016-12-06T04:11:33Z")

</div>

Hi,

I would like to restart a server and wait till the services start up. I can us the wait\_for module to wait for ports to be up, but how can I wait for the services to be up? The service modules seem to start,stop or restart service, but I don’t want to do any of these operations. Only wait till services are up. On linux I am able to run a command and loop until it returns true. But is there a direct support for this in Ansible or the Services module?

Thanks

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [December 8, 2016, 6:56am UTC](https://forum.ansible.com/t/right-way-to-wait-for-service-start/23176/2 "2016-12-08T06:56:19Z")

</div>

Check out until  
[https://docs.ansible.com/ansible/playbooks\_loops.html#do-until-loops](https://docs.ansible.com/ansible/playbooks_loops.html#do-until-loops)
