# Is changing my ControlPath causing misdirected commands?

**URL:** <https://forum.ansible.com/t/is-changing-my-controlpath-causing-misdirected-commands/19024>\
**Category:** Ansible Project\
**Created:** [August 14, 2015, 10:30pm UTC](https://forum.ansible.com/t/is-changing-my-controlpath-causing-misdirected-commands/19024 "2015-08-14T22:30:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Larry\_Fast](https://avatars.discourse-cdn.com/v4/letter/l/b3f665/32.png) [@Larry\_Fast](https://forum.ansible.com/u/Larry_Fast)\
**Post date:** [August 14, 2015, 10:30pm UTC](https://forum.ansible.com/t/is-changing-my-controlpath-causing-misdirected-commands/19024/1 "2015-08-14T22:30:00Z")

</div>

I ran into the ‘unix\_listener: “/home/my\_name/.ansible/cp/ansible-ssh-vvvvvveerrrrryyyyy\_looonnnngggggg\_ssserrrveeerrr\_nnnaaammmmeeeee.5GoIZEXF2gwQ7DF0” too long for Unix domain socket’ so I tried changing ControlPath to %(directory)s/ansible-ssh-%%r

Then all my remote commands started getting executed on localhost even though the logs indicated they were running on the target hosts. So I’m guessing ControlPath is the problem. yes?

If so, is there a more appropriate solution to this problem?

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [August 14, 2015, 10:38pm UTC](https://forum.ansible.com/t/is-changing-my-controlpath-causing-misdirected-commands/19024/2 "2015-08-14T22:38:46Z")

</div>

The controlpath uses %r, %h and %p to differentiate socket files for different hosts.

In particular %h is for the host name. I see you only have %r which is the remote username. By removing %h you will most definitely run into a situation where you are running commands on the wrong host, since it is using a control socket for the first host that is connected to.

You can use other paths instead of %(directory) or remove ansible-ssh- from the path for making it shorter.
