コンテンツにスキップ
#0092
Daemon

Restart Postgres without an SSH session

Postgres is wedged. Connection pool exhausted, queries piling up, the usual signs. Old playbook: ssh through the bastion, sudo to the postgres user, run systemctl restart postgresql, hope nothing else broke.

You hit POST /api/v1/daemon/programs/{postgres_id}/stop. Fifteen seconds later, POST /api/v1/daemon/programs/{postgres_id}/start. You GET the status, see RUNNING with a fresh PID, watch uptime climb. You did this from a phone, on a train, with no keypair, no jumphost, no bastion config that drifts every quarter.

The same daemon supervises Redis, the worker pool, the metrics agent. Every one of them is a URL with a stop-button and a start-button. The restart sequence is three POSTs, not three privilege escalations.

The bastion outlived its job the day Postgres got a URL.