Skip to content

Commit

Permalink
Fix machine_checks example error (#1796)
Browse files Browse the repository at this point in the history
The machine_checks toml example showed `/bin/sh -c` being given multiple
arguments. But /bin/sh -c should be given a single argument that's a
long single string containing the bash to execute.
  • Loading branch information
IohannesArnold authored Aug 21, 2024
1 parent 0feaf4d commit 094e335
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions reference/configuration.html.markerb
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ You can use the same `machine_checks` section for HTTP services as for [`service
[http_services.machine_checks]
image = "curlimages/curl"
entrypoint = ["/bin/sh", "-c"]
command = ["curl", "$FLY_TEST_MACHINE_IP", "|", "grep", "Hello, World!"]
command = ["curl http://[$FLY_TEST_MACHINE_IP] | grep 'Hello, World!'"]
kill_signal = "SIGKILL"
kill_timeout = "5s"
```
Expand Down Expand Up @@ -662,13 +662,13 @@ Times are in milliseconds unless units are specified.

### `services.machine_checks`

Machine checks work a bit differently than the other checks. They run on each deploy, and if they fail, the deploy is stopped. A new Machine is spawned with the environment variable `FLY_TEST_MACHINE_IP` set to the IP address of the Machine being tested. This is useful for running integration tests on Machines before a deployment. Here's an example:
Machine checks work a bit differently than the other checks. They run on each deploy, and if they fail, the deploy is stopped. A new Machine is spawned with the environment variable `FLY_TEST_MACHINE_IP` set to the [6PN IPv6 address](/docs/networking/private-networking/#6pn-addresses-in-detail) of the Machine being tested. This is useful for running integration tests on Machines before a deployment. Here's an example:

```toml
[[services.machine_checks]]
image = "curlimages/curl"
entrypoint = ["/bin/sh", "-c"]
command = ["curl", "$FLY_TEST_MACHINE_IP", "|", "grep", "Hello, World!"]
command = ["curl http://[$FLY_TEST_MACHINE_IP] | grep 'Hello, World!'"]
kill_signal = "SIGKILL"
kill_timeout = "5s"
```
Expand Down

0 comments on commit 094e335

Please sign in to comment.