PG_AUTOCTL STOP(1)

PG_AUTOCTL STOP(1) πŸ’…

okay bestie, so this one lives in the pg_auto_failover manual, and it's literally called pg_autoctl stop. Yeah. That's the whole name. Iconic minimalism honestly.


✨ NAME ✨

pg_autoctl stop β€” pg_autoctl stop

pg_autoctl stop β€” signal the pg_autoctl service for it to stop πŸ›‘


🌸 SYNOPSIS 🌸

So basically this command stops the processes you need to run a monitor node or a keeper node β€” which one it goes for depends on the configuration file that belongs to the --pgdata option or the PGDATA environment variable. no cap.

usage: pg_autoctl stop  [ --pgdata --fast --immediate ]

--pgdata      path to data directory
--fast        fast shutdown mode for the keeper
--immediate   immediate shutdown mode for the keeper

πŸ¦‹ DESCRIPTION πŸ¦‹

The pg_autoctl stop command goes and finds the PID of the running service for whatever --pgdata you gave it, and if that process is still running, it sends a SIGTERM signal to it. that's it. that's the move. πŸ’Œ

When pg_autoclt receives a shutdown signal, a shutdown sequence gets triggered. And depending on which signal it received, an operation that's already been started (like, say, a state transition) is either:

  • run to completion 🏁
  • stopped as the next opportunity comes up ⏸️
  • or stopped immediately, even when it's mid-transition πŸ’€
so yeah, the signal you pick genuinely changes the vibe of the shutdown. choose wisely bestie.

πŸ’– OPTIONS πŸ’–

  • --pgdata β€” Location of the Postgres node being managed locally. Defaults to the environment variable PGDATA. Use --monitor to connect to a monitor from anywhere, rather than the monitor URI used by a local Postgres node managed with pg_autoctl.
  • --fast β€” Fast Shutdown mode for pg_autoctl. Sends the SIGINT signal to the running service, which is the same as using C-c on an interactive process running as a foreground shell job. ✨
  • --immediate β€” Immediate Shutdown mode for pg_autoctl. Sends the SIGQUIT signal to the running service. 🫒

🌈 ENVIRONMENT 🌈

  • PGDATA β€” Postgres directory location. Can be used instead of the --pgdata option.
  • PG_AUTOCTL_MONITOR β€” Postgres URI to connect to the monitor node, can be used instead of the --monitor option.
  • XDG_CONFIG_HOME β€” The pg_autoctl command stores its configuration files in the standard place XDG_CONFIG_HOME. See the XDG Base Directory Specification.
  • XDG_DATA_HOME β€” The pg_autoctl command stores its internal states files in the standard place XDG_DATA_HOME, which defaults to ~/.local/share. See the XDG Base Directory Specification.

πŸ‘‘ AUTHOR πŸ‘‘

Microsoft


Copyright (c) Microsoft Corporation. All rights reserved.


okay that's the whole thing, you ate it, go stop your nodes responsibly πŸ’œ

this was version 2.2, dated Apr 07, 2025 β€” pg_autoctl stop, signing off 🫢🌸

πŸ“¦ where this page comes from