# Execute a method on service startup

**URL:** <https://discourse.nameko.io/t/execute-a-method-on-service-startup/512>\
**Category:** Uncategorized\
**Created:** [November 2, 2019, 10:25pm UTC](https://discourse.nameko.io/t/execute-a-method-on-service-startup/512 "2019-11-02T22:25:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![litmax](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.nameko.io/litmax/32/67_2.png) [@litmax](https://discourse.nameko.io/u/litmax)\
**Post date:** [November 2, 2019, 10:25pm UTC](https://discourse.nameko.io/t/execute-a-method-on-service-startup/512/1 "2019-11-02T22:25:34Z")

</div>

Hello folks!  
Tried to search on `auto start` / `autostart` but got nothing…

Imagine that I have a service using some extension for example a chat bot message entrypoint.

So when smbd send a message service’s method is fired via this entrypoint.

But what if I need to send a message first? I mean not in reaction but as soon I the service is started.

Is there a method if keeping usage of nameko run … ?

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![litmax](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.nameko.io/litmax/32/67_2.png) [@litmax](https://discourse.nameko.io/u/litmax)\
**Post date:** [November 21, 2019, 10:46am UTC](https://discourse.nameko.io/t/execute-a-method-on-service-startup/512/2 "2019-11-21T10:46:49Z")

</div>

I found the following method.  
I use Supervisord to run Nameko services.  
I use Supervisord eventlistener which executes nameko shell schript which calls service rpc method to perform startup procedures.

---

<div class="post-metadata">

**Author:** ![litmax](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.nameko.io/litmax/32/67_2.png) [@litmax](https://discourse.nameko.io/u/litmax)\
**Post date:** [December 5, 2019, 9:58am UTC](https://discourse.nameko.io/t/execute-a-method-on-service-startup/512/3 "2019-12-05T09:58:31Z")

</div>

I found one more solution for this - “Once” entrypoint from here - [https://github.com/topiaruss/nameko-chat/blob/master/chat/entrypoints/once.py](https://github.com/topiaruss/nameko-chat/blob/master/chat/entrypoints/once.py)  
Simple and nice approach 🙂
