#!/sbin/openrc-run # Copyright 1999-2026 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 description="pgBackRest TLS server (remote repository access)" supervisor="supervise-daemon" command="/usr/bin/pgbackrest" command_args="server ${PGBACKREST_ARGS}" command_user="${PGBACKREST_USER:-postgres}:${PGBACKREST_GROUP:-postgres}" required_files="${PGBACKREST_CONF:-/etc/pgbackrest.conf} /etc/pgbackrest/pgbackrest.conf" depend() { need net use dns logger } start_pre() { # pgbackrest reads /etc/pgbackrest.conf OR /etc/pgbackrest/pgbackrest.conf: one of them must exist [ -e /etc/pgbackrest.conf ] || [ -e /etc/pgbackrest/pgbackrest.conf ] || { eerror "no pgbackrest configuration found"; return 1; } checkpath -d -m 0750 -o postgres:postgres /var/log/pgbackrest /var/spool/pgbackrest }