# External-check with chroot not working

**URL:** https://discourse.haproxy.org/t/external-check-with-chroot-not-working/4761
**Category:** Help!
**Created:** [January 23, 2020, 10:51am UTC](https://discourse.haproxy.org/t/external-check-with-chroot-not-working/4761 "2020-01-23T10:51:11Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discourse.haproxy.org/u/asp)
#### Post date: [January 23, 2020, 10:51am UTC](https://discourse.haproxy.org/t/external-check-with-chroot-not-working/4761/1 "2020-01-23T10:51:11Z")

</div>

Hi,

I am trying to get an external-check running together with chroot. For simpliness to show the issue I will just call /bin/true as check.

I tried the following:

without chroot:

```
backend bk_redis
    option external-check
    external-check command /bin/true
    server elastic01.example.com_7000 localhost:7000 check inter 1s
    server elastic02.example.com_7001 localhost:7001 check inter 1s

```

that one is working. Both servers are returned as available as expected.

Now my changes with chroot:  
first, I copied /bin/true to /var/opt/rh/rh-haproxy18/lib/haproxy/true

then I changed the config:

```
global
    chroot /var/opt/rh/rh-haproxy18/lib/haproxy

backend bk_redis
    option external-check
    external-check command /true
    server elastic01.example.com_7000 localhost:7000 check inter 1s
    server elastic02.example.com_7001 localhost:7001 check inter 1s

```

But here I get only this error:

```
[WARNING] 022/114401 (2119) : Server bk_redis/elastic01.internal.dtpublic.de_7000 is DOWN, reason: External check error, code: 255, check duration: 14ms. 1 active and 0
[ALERT] 022/114402 (2127) : Failed to exec process for external health check: No such file or directory. Aborting.
[ALERT] 022/114403 (2128) : Failed to exec process for external health check: No such file or directory. Aborting.
[ALERT] 022/114403 (2131) : Failed to exec process for external health check: No such file or directory. Aborting.

```

I am not so familar with chroot. Can you point out, where my mistake is?

Thanks, Andreas

---

<div class="post-metadata">

### Author: ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)
#### Post date: [January 23, 2020, 4:35pm UTC](https://discourse.haproxy.org/t/external-check-with-chroot-not-working/4761/2 "2020-01-23T16:35:04Z")

</div>

Use the chroot command to test it yourself:

> **[Linux / Unix: chroot Command Examples - nixCraft](https://www.cyberciti.biz/faq/unix-linux-chroot-command-examples-usage-syntax/)**
>
> I am a new Linux and Unix user. How do I change the root directory of a command? How do I change the root directory of a process such as web-server using a chroot command to isolate file system? How do I use a chroot to recover password or fix the...

There is nothing special about haproxy’s chroot functionality.

Btw I still think you should drop stunnel and do everything in haproxy instead. This will fix all your issues and make your setup simpler.

---

<div class="post-metadata">

### Author: ![jlecour](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/jlecour/32/986_2.png) [@jlecour](https://discourse.haproxy.org/u/jlecour)
#### Post date: [May 8, 2020, 7:50am UTC](https://discourse.haproxy.org/t/external-check-with-chroot-not-working/4761/3 "2020-05-08T07:50:35Z")

</div>

Hi,

Did you find a solution to your issue?

I have the same problem and can’t find the correct way to do this.

Thanks.

---

<div class="post-metadata">

### Author: ![jlecour](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/jlecour/32/986_2.png) [@jlecour](https://discourse.haproxy.org/u/jlecour)
#### Post date: [May 8, 2020, 8:06am UTC](https://discourse.haproxy.org/t/external-check-with-chroot-not-working/4761/4 "2020-05-08T08:06:42Z")

</div>

I’ve posted a solution here : [External-check and chroot](https://discourse.haproxy.org/t/external-check-and-chroot/2150/14)
