# Rancher agents trouble

**URL:** <https://forums.suse.com/t/rancher-agents-trouble/4003>\
**Category:** Rancher 1.x\
**Created:** [September 14, 2016, 7:13am UTC](https://forums.suse.com/t/rancher-agents-trouble/4003 "2016-09-14T07:13:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cabrinoob](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/cabrinoob/32/1343_2.png) [@cabrinoob](https://forums.suse.com/u/cabrinoob)\
**Post date:** [September 14, 2016, 7:13am UTC](https://forums.suse.com/t/rancher-agents-trouble/4003/1 "2016-09-14T07:13:47Z")

</div>

Hi,  
I have some strange problem with rancher agent on some of my hosts. I have 2 rancher agents that are running :

- rancher/agent:v1.0.2 (with name = rancher-agent)
- rancher/agent:latest (with name = rancher-agent-init)

And they are both restarting randomly.

I have two kinds of host : Hyper-V (on premise) VM and Amazon EC2 VM. For the Hyper-V VMs I have manually added them in my rancher environment. For the EC2 VMs I have added them through a Chef recipe.

In this chef recipe I install docker engine, rancher agent, registrator and consul agent. I think I have a problem in this recipe because I end up with rancher-agent and rancher-agent-init only on EC2 created via chef.

So, I’d like to know what it’s the difference between rancher-agent and rancher-agent-init ?

Thank you

---

<div class="post-metadata">

**Author:** ![cabrinoob](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/cabrinoob/32/1343_2.png) [@cabrinoob](https://forums.suse.com/u/cabrinoob)\
**Post date:** [September 14, 2016, 12:15pm UTC](https://forums.suse.com/t/rancher-agents-trouble/4003/2 "2016-09-14T12:15:10Z")

</div>

Ok, I have found my problem. I had setup a restart policy “always” on the rancher agent in my chef recipe. But I did not know that this container proceed a sort of two-phases starting. The rancher-agent-init seems to create the rancher-agent and then shut down itself.

But with the restart policy the rancher-agent-init always came back to life like a zombie and recreate the rancher-agent container.

So I remove the restart policy and everything is workong fine now.
