From 0cd1fe0148f505319d48e60596fe0ee9fe2d48f3 Mon Sep 17 00:00:00 2001 From: James Campbell Date: Wed, 15 Jan 2025 01:34:04 -0500 Subject: [PATCH] Package logrotate script --- {gentoo => GENTOO}/pgmon-0.1.0.ebuild | 0 {gentoo => GENTOO}/pgmon-1.0.0.ebuild | 2 +- Makefile | 3 +++ RPM/pgmon.spec | 5 +++-- {gentoo/files => logrotate}/pgmon.logrotate | 0 openrc/pgmon.openrc | 4 +++- 6 files changed, 10 insertions(+), 4 deletions(-) rename {gentoo => GENTOO}/pgmon-0.1.0.ebuild (100%) rename {gentoo => GENTOO}/pgmon-1.0.0.ebuild (97%) rename {gentoo/files => logrotate}/pgmon.logrotate (100%) diff --git a/gentoo/pgmon-0.1.0.ebuild b/GENTOO/pgmon-0.1.0.ebuild similarity index 100% rename from gentoo/pgmon-0.1.0.ebuild rename to GENTOO/pgmon-0.1.0.ebuild diff --git a/gentoo/pgmon-1.0.0.ebuild b/GENTOO/pgmon-1.0.0.ebuild similarity index 97% rename from gentoo/pgmon-1.0.0.ebuild rename to GENTOO/pgmon-1.0.0.ebuild index 9b2c0db..18766bc 100644 --- a/gentoo/pgmon-1.0.0.ebuild +++ b/GENTOO/pgmon-1.0.0.ebuild @@ -15,7 +15,7 @@ SLOT="0" KEYWORDS="amd64" EGIT_REPO_URI="https://code2.shh-dot-com.org/james/pgmon.git" -#EGIT_COMMIT="" +EGIT_COMMIT="v1.0.0" DEPEND=" ${PYTHON_DEPS} diff --git a/Makefile b/Makefile index af0f12a..cbd1f51 100644 --- a/Makefile +++ b/Makefile @@ -69,6 +69,9 @@ install: # Install systemd unit files cp systemd/* $(DESTDIR)/lib/systemd/system/ + + # Install logrotate config + cp logrotate/${PACKAGE_NAME}.logrotate ${DESTDIR}/etc/logrotate.d/${PACKAGE_NAME} install-tests: debian-install-test rocky-install-test ubuntu-install-test diff --git a/RPM/pgmon.spec b/RPM/pgmon.spec index 8c83d3f..9f2bf31 100644 --- a/RPM/pgmon.spec +++ b/RPM/pgmon.spec @@ -22,13 +22,14 @@ A bridge to sit between monitoring tools and PostgreSQL make -C /src install DESTDIR=%{buildroot} %files -/usr/local/bin/pgmon -/usr/share/man/man1/pgmon.1.gz +/etc/logrotate.d/pgmon /etc/pgmon/pgmon.yml /etc/pgmon/pgmon-metrics.yml /etc/pgmon/pgmon-service.conf /lib/systemd/system/pgmon.service /lib/systemd/system/pgmon@.service +/usr/local/bin/pgmon +/usr/share/man/man1/pgmon.1.gz %post mkdir -p -m 0755 /var/log/pgmon diff --git a/gentoo/files/pgmon.logrotate b/logrotate/pgmon.logrotate similarity index 100% rename from gentoo/files/pgmon.logrotate rename to logrotate/pgmon.logrotate diff --git a/openrc/pgmon.openrc b/openrc/pgmon.openrc index 51cea0f..e3fc0c1 100644 --- a/openrc/pgmon.openrc +++ b/openrc/pgmon.openrc @@ -7,9 +7,11 @@ supervisor="supervise-daemon" agent_name=${SVCNAME#pgmon.} agent_name=${agent_name:-pgmon} +PGMON_USER="${PGMON_USER:-postgres}" +PGMON_GROUP="${PGMON_GROUP:-$PGMON_USER}" CONFIG_FILE="/etc/pgmon/${agent_name}.yml" command="/usr/bin/pgmon" command_args="'$CONFIG_FILE'" command_background="true" -command_user="zabbix:zabbix" +command_user="${PGMON_USER}:${PGMON_GROUP}"