LinuxCommandLibrary

pueue-shutdown

Gracefully shutdown the Pueue daemon

TLDR

Shutdown the daemon without a service manager

$ pueue shutdown
copy

SYNOPSIS

pueue-shutdown [GLOBAL_OPTIONS]

PARAMETERS

-c FILE, --config FILE
    Specifies a custom configuration file for Pueue. By default, Pueue looks for its configuration in standard locations like ~/.config/pueue.yml.

-d NAME, --daemon NAME
    Connects to a specific Pueue daemon instance identified by NAME. This is useful when running multiple Pueue daemons concurrently.

-H HOST, --host HOST
    Connects to a Pueue daemon running on a remote HOST. By default, Pueue connects locally via a Unix socket or localhost.

-P PORT, --port PORT
    Connects to a Pueue daemon on a specific TCP PORT when connecting to a remote host or via TCP locally.

DESCRIPTION

The `pueue-shutdown` command is used to gracefully terminate the running Pueue daemon. Pueue operates on a client-server model, where the daemon (server) manages task queues in the background, and the `pueue` client commands interact with it. When `pueue-shutdown` is executed, the client sends a signal to the active Pueue daemon, instructing it to prepare for termination.

Upon receiving the shutdown signal, the Pueue daemon will typically complete any currently executing tasks and then stop processing new commands. It ensures a clean exit, preserving the state of pending tasks so they can be resumed when the daemon is restarted. This command is crucial for maintaining data integrity and avoiding abrupt interruptions to your automation workflows. It's often used when upgrading Pueue, performing system maintenance, or simply when the task queueing service is no longer needed. Unlike forcibly killing the daemon, `pueue-shutdown` allows for a controlled and safe cessation of operations, preventing potential data corruption or orphaned processes.

CAVEATS

The `pueue-shutdown` command requires a running Pueue daemon to connect to. If no daemon is active or reachable (e.g., due to network issues, incorrect configuration, or permissions), the command will report an error indicating it could not connect. While the command aims for a graceful shutdown, tasks that are extremely long-running might delay the daemon's full termination. It's important to ensure that the client executing the command has the necessary permissions to communicate with the daemon's socket or port.

GRACEFUL TERMINATION BEHAVIOR

When `pueue-shutdown` is invoked, the Pueue daemon prioritizes the completion of currently running tasks before initiating its exit sequence. This design ensures that ongoing processes are not abruptly terminated, thereby preventing potential data loss or corrupted outputs. Only after all active tasks have finished, or if no tasks were running, does the daemon fully shut down. This behavior is crucial for automated environments where task integrity is paramount.

CONNECTION MECHANISM

The `pueue-shutdown` command, like other `pueue` client commands, communicates with the Pueue daemon primarily via a Unix socket on the local machine by default. For remote connections or specific local setups, it can also communicate over TCP. The connection method is typically determined by the daemon's configuration and the client's options (`--host`, `--port`).

HISTORY

Pueue is a relatively modern, open-source task queue manager written in Rust, developed by Christoph Burgdorf. It was created to provide a simple, powerful, and robust way to manage background tasks and commands on Linux systems. Its development focuses on reliability, ease of use, and a clear client-server architecture, making `pueue-shutdown` an integral part of its operational lifecycle for controlled daemon management.

SEE ALSO

pueue(1), pueue-daemon(1), pueue-status(1), pueue-add(1), pueue-start(1)

Copied to clipboard