# "unrecognized service" for custom upstart script on CentOS 6.5

**URL:** <https://forum.ansible.com/t/unrecognized-service-for-custom-upstart-script-on-centos-6-5/17795>\
**Category:** Ansible Project\
**Created:** [March 19, 2015, 8:17pm UTC](https://forum.ansible.com/t/unrecognized-service-for-custom-upstart-script-on-centos-6-5/17795 "2015-03-19T20:17:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Skyler\_Slade](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@Skyler\_Slade](https://forum.ansible.com/u/Skyler_Slade)\
**Post date:** [March 19, 2015, 8:17pm UTC](https://forum.ansible.com/t/unrecognized-service-for-custom-upstart-script-on-centos-6-5/17795/1 "2015-03-19T20:17:22Z")

</div>

I have a custom upstart script that starts, stops, and restarts successfully via initctl but when Ansible attempts the same, it errors with the message “unrecognized service”.

I’ve seen [https://github.com/ansible/ansible/issues/2183](https://github.com/ansible/ansible/issues/2183) which indicates that the issue is fixed, but it’s still happening to me.

Here’s my upstart script in its entirety, /etc/init/nginx-log-monitor.conf:

description “Nginx error log monitor”

start on runlevel [345]  
stop on runlevel [6]

exec /usr/local/bin/logmonitor.sh /var/log/nginx/error.log ‘[crit|error’ ‘me@domain.com’

And the error from Ansible:

NOTIFIED: [nginx\_base | restart nginx log monitor] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
failed: [[web.domain.com](http://web.domain.com)] =\> {“failed”: true}  
msg: nginx-log-monitor: unrecognized service  
nginx-log-monitor: unrecognized service

Is there something wrong with my upstart script?

---

<div class="post-metadata">

**Author:** ![Skyler\_Slade](https://avatars.discourse-cdn.com/v4/letter/s/e47774/32.png) [@Skyler\_Slade](https://forum.ansible.com/u/Skyler_Slade)\
**Post date:** [March 20, 2015, 1:21pm UTC](https://forum.ansible.com/t/unrecognized-service-for-custom-upstart-script-on-centos-6-5/17795/2 "2015-03-20T13:21:08Z")

</div>

I should note that I’m using the devel branch and the last commit that I have is 6264eb4e02eff67a1701.
