# Manage A Daemon Lifecycle This tutorial uses {func}`handler ` to declare a local workstation, inspect lifecycle status, and manage the daemon in a `with` block. It does not submit a solve. The `with` block starts and connects the daemon, then stops it when the block ends. The final explicit startup and shutdown calls show lifecycle control without a `with` block. Set `JCMROOT` and ensure that the local daemon is available before you run the tutorial from the tutorial root: ```bash python execution_runtime/daemon/01_lifecycle/run.py ``` ## Python File ```{literalinclude} ../../../../demos/documentation_tutorials/execution_runtime/daemon/01_lifecycle/run.py :language: python ```