Skip to content

"mkdocs serve" does not cleanup after a SIGTERM #3905

Description

@toddke

It looks like mkdocs does not handle SIGTERM and leaves its temporary site_dir in the /tmp directory. These directories are never cleaned up. mkdocs should handle SIGTERM and/or cleanup leftover /tmp directories on startup.

My setup

I run mkdocs inside a docker container [see the mkdocs-material project]. By default, the docker starts "mkdocs serve".

The issue occurs when the container is stopped. To stop a container, docker sends SIGTERM to the main process and waits for the signal to be handled. In the case of mkdocs-material, the main process is tini, but tini already forwards signals to the child mkdocs process. To confirm the behaviour, I've also sent SIGTERM directly to mkdocs [eg. kill -s TERM <mkdocs-pid>] and mkdocs still fails to clean up /tmp directories.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions