# New "pattern=" for the service module

**URL:** <https://forum.ansible.com/t/new-pattern-for-the-service-module/11807>\
**Category:** Ansible Project\
**Created:** [August 18, 2012, 12:29am UTC](https://forum.ansible.com/t/new-pattern-for-the-service-module/11807 "2012-08-18T00:29:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Michael\_DeHaan](https://avatars.discourse-cdn.com/v4/letter/m/c4cdca/32.png) [@Michael\_DeHaan](https://forum.ansible.com/u/Michael_DeHaan)\
**Post date:** [August 18, 2012, 12:29am UTC](https://forum.ansible.com/t/new-pattern-for-the-service-module/11807/1 "2012-08-18T00:29:10Z")

</div>

As we all know, whether an init script reports an accurate status or not is one of the most frustrating thing in managing computers. Most init scripts are terrible.

Stephen Fromm has added a nice patch that we've been looking for for a while. Assume the service foo doesn't support "status", you can now do stuff like this:

service name=foo pattern=/usr/sbin/foo state=started

And the service status will be inferred by looking for the above string in the output of the 'ps' command.

I know a lot of people will be really happy to see this. Thanks Stephen!

--Michael

---

<div class="post-metadata">

**Author:** ![James8](https://avatars.discourse-cdn.com/v4/letter/j/ec9cab/32.png) [@James8](https://forum.ansible.com/u/James8)\
**Post date:** [October 4, 2012, 9:45pm UTC](https://forum.ansible.com/t/new-pattern-for-the-service-module/11807/2 "2012-10-04T21:45:46Z")

</div>

I have used this and it is awesome.

James
