pgmon/openrc/pgmon.initd

25 lines
583 B
Plaintext
Raw Permalink Normal View History

2024-06-02 03:46:30 +00:00
#!/sbin/openrc-run
extra_started_commands="reload"
2024-10-25 06:45:14 +00:00
supervisor="supervise-daemon"
agent_name=${SVCNAME#pgmon.}
2024-06-02 03:46:30 +00:00
agent_name=${agent_name:-pgmon}
2025-01-15 06:34:04 +00:00
PGMON_USER="${PGMON_USER:-postgres}"
PGMON_GROUP="${PGMON_GROUP:-$PGMON_USER}"
2024-10-25 06:45:14 +00:00
CONFIG_FILE="/etc/pgmon/${agent_name}.yml"
2024-06-02 03:46:30 +00:00
output_log=/var/log/pgmon/${SVCNAME}.log
error_log=/var/log/pgmon/${SVCNAME}.err
start_pre() {
checkpath -f -m 0644 -o "${PGMON_USER}:${PGMON_GROUP}" "${output_log}" "${error_log}"
}
2024-06-06 04:51:04 +00:00
command="/usr/bin/pgmon"
2024-10-25 06:45:14 +00:00
command_args="'$CONFIG_FILE'"
2024-06-06 04:51:04 +00:00
command_background="true"
2025-01-15 06:34:04 +00:00
command_user="${PGMON_USER}:${PGMON_GROUP}"