saturnin._scripts.commands.daemons¶
Typer commands for managing Saturnin daemon processes.
This module provides CLI commands to list currently running Saturnin daemons,
show detailed information about a specific daemon process, and stop a running
daemon. Daemons are typically Saturnin recipes executed in DAEMON mode.
Globals¶
Command functions¶
- saturnin._scripts.commands.daemons.list_daemons() None[source]¶
Lists all currently running Saturnin daemon processes.
Displays a table with the PID, status, associated recipe name, and a brief description of the recipe for each running daemon. If a daemon’s recipe has been uninstalled, it’s marked accordingly.
- Return type:
None
- saturnin._scripts.commands.daemons.show_daemon(pid: ~typing.Annotated[int, <typer.models.ArgumentInfo object at 0x7092a3308090>]) None[source]¶
Displays detailed information about a running Saturnin daemon process.
Information includes process status, creation time, resource usage (CPU, memory, I/O), command line, and associated user.
- saturnin._scripts.commands.daemons.stop_daemon(pid: ~typing.Annotated[int, <typer.models.ArgumentInfo object at 0x7092a3489d50>]) None[source]¶
Stops a running Saturnin daemon process.
This command attempts a graceful shutdown by sending the appropriate signal (SIGINT on Unix, CTRL_C_EVENT on Windows) to the daemon.
Functions¶
- saturnin._scripts.commands.daemons.get_first_line(text: str) str[source]¶
Returns the first non-empty line from the input string.
- saturnin._scripts.commands.daemons.get_running_daemons() dict[int, str][source]¶
Scans Saturnin’s PID directory to identify running daemon processes.
It checks each
pidfile, reads the associated recipe name, and verifies if the process with that PID is still running usingpsutil. If a PID file points to a non-existent process, the stale PID file is removed.
- saturnin._scripts.commands.daemons.pid_completer(ctx, args, incomplete) list[tuple[str, str]][source]¶
Click/Typer autocompletion function for running Saturnin daemon PIDs.
Provides a list of (PID, recipe_name) tuples for autocompletion suggestions.
- Parameters:
ctx – The Click/Typer context.
args – The current command arguments.
incomplete – The partially typed PID.
- Returns:
A list of tuples, where each tuple contains the PID as a string and the associated recipe name (or an empty string if the recipe is unknown).
- Return type: