# Match\_terminate isn't called when server gracefully shuts down (SOLVED)

**URL:** <https://forum.heroiclabs.com/t/match-terminate-isnt-called-when-server-gracefully-shuts-down-solved/5212>\
**Category:** Game Design\
**Created:** [April 26, 2024, 4:48pm UTC](https://forum.heroiclabs.com/t/match-terminate-isnt-called-when-server-gracefully-shuts-down-solved/5212 "2024-04-26T16:48:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![totebo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/totebo/32/528_2.png) [@totebo](https://forum.heroiclabs.com/u/totebo)\
**Post date:** [April 26, 2024, 4:48pm UTC](https://forum.heroiclabs.com/t/match-terminate-isnt-called-when-server-gracefully-shuts-down-solved/5212/1 "2024-04-26T16:48:07Z")

</div>

**Update:** I was able to fix this by changing the `docker-compose.yml` entrypoint from

```auto
 entrypoint:
      - "/bin/sh"

```

to

```auto
 entrypoint:
      - "/bin/bash"

```

It might be worth updating the documentation, linked below, to reflect this in case someone else bumps into this issue.

**Original post:**

I’m using Docker to start and stop Nakama, and Lua modules for the game logic. When Nakama is stopped, the function `M.match_terminate()` isn’t called in active matches for some reason.

I found [this post](https://forum.heroiclabs.com/t/matchterminate-function-is-not-getting-called-in-nakama-2-11-1/643), but wasn’t able to find an answer there.

I’m using this guide for the Docker setup:

> **[Docker Compose](https://heroiclabs.com/docs/nakama/getting-started/install/docker/)**
>
> See the prerequisites and installation procedure for running Nakama via Docker.

The `shutdown_grace_sec` is set to 10 in `config.yml`. Is there something else that need to be set for the `match_terminate()` function to trigger on shutdown?
