# How to check if Sandbox is running as a background process

**URL:** <https://forum.canton.network/t/how-to-check-if-sandbox-is-running-as-a-background-process/3535>\
**Category:** App Development\
**Tags:** sandbox\
**Created:** [December 7, 2021, 3:43pm UTC](https://forum.canton.network/t/how-to-check-if-sandbox-is-running-as-a-background-process/3535 "2021-12-07T15:43:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nemanja](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/nemanja/32/842_2.png) [@nemanja](https://forum.canton.network/u/nemanja)\
**Post date:** [December 7, 2021, 3:43pm UTC](https://forum.canton.network/t/how-to-check-if-sandbox-is-running-as-a-background-process/3535/1 "2021-12-07T15:43:50Z")

</div>

What would be the best way to check if Sandbox is running as a background process (with default parameters)? Would it be using `ps x`?

---

<div class="post-metadata">

**Author:** ![Gary\_Verhaegen](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gary_verhaegen/32/81_2.png) [@Gary\_Verhaegen](https://forum.canton.network/u/Gary_Verhaegen)\
**Post date:** [December 7, 2021, 5:10pm UTC](https://forum.canton.network/t/how-to-check-if-sandbox-is-running-as-a-background-process/3535/2 "2021-12-07T17:10:32Z")

</div>

“Best” will definitely depend on your context here. I personally like to check if the port is open, with something like:

```shell
while ! nc -z localhost:6865; do sleep 1; done

```

Well, I’m usually _waiting_ for a sandbox; if you just wanted to check, you can change that `while` into an `if`.

This only tells you that _something_ has that port open; if you’re in a context where you may not know whether that something _is_ a sandbox, you may want to instead send a query to it with grpcrul, perhaps to an unauthenticated endpoint like [ListKnownPackages](https://docs.daml.com/app-dev/grpc/proto-docs.html#listknownpackagesrequest) or GetLedgerIdentityRequest.

---

<div class="post-metadata">

**Author:** ![nemanja](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/nemanja/32/842_2.png) [@nemanja](https://forum.canton.network/u/nemanja)\
**Post date:** [December 7, 2021, 6:13pm UTC](https://forum.canton.network/t/how-to-check-if-sandbox-is-running-as-a-background-process/3535/3 "2021-12-07T18:13:49Z")

</div>

Thnx for the super speedy reply @Gary_Verhaegen 😀 What would be the shell command for `grpcrul` to `ListKnownPackages`? I realise I’m being a but spoiled and ask for a full solution 🙂

---

<div class="post-metadata">

**Author:** ![Gary\_Verhaegen](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/gary_verhaegen/32/81_2.png) [@Gary\_Verhaegen](https://forum.canton.network/u/Gary_Verhaegen)\
**Post date:** [December 7, 2021, 6:18pm UTC](https://forum.canton.network/t/how-to-check-if-sandbox-is-running-as-a-background-process/3535/4 "2021-12-07T18:18:14Z")

</div>

I have no idea, I’ve never used grpcurl myself. Sorry, that’s as far as I’m able to take you tonight.

---

<div class="post-metadata">

**Author:** ![cocreature](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/cocreature/32/36_2.png) [@cocreature](https://forum.canton.network/u/cocreature)\
**Post date:** [December 7, 2021, 7:31pm UTC](https://forum.canton.network/t/how-to-check-if-sandbox-is-running-as-a-background-process/3535/5 "2021-12-07T19:31:24Z")

</div>

Rather than using the party management service which still requires a valid token (but no specific claims), I’d recommend the healthcheck endpoint. You can talk to that via grpcurl using the following command

```haskell
grpcurl -plaintext localhost:6865 grpc.health.v1.Health/Check

```

---

<div class="post-metadata">

**Author:** ![nemanja](https://yyz2.discourse-cdn.com/flex034/user_avatar/forum.canton.network/nemanja/32/842_2.png) [@nemanja](https://forum.canton.network/u/nemanja)\
**Post date:** [December 8, 2021, 9:37am UTC](https://forum.canton.network/t/how-to-check-if-sandbox-is-running-as-a-background-process/3535/6 "2021-12-08T09:37:48Z")

</div>

> [@cocreature](#):
>
> `grpcurl -plaintext localhost:6865 grpc.health.v1.Health/Check`

Awesome, that did the trick! Running the command returns

```haskell
{
  "status": "SERVING"
}

```

Thnx for your help @Gary_Verhaegen and @cocreature!
