Update systemd service and add EnvironmentFile
This commit is contained in:
parent
46489b2f85
commit
4b7cc065d2
5 changed files with 50 additions and 28 deletions
8
.SRCINFO
8
.SRCINFO
|
@ -1,17 +1,19 @@
|
||||||
pkgbase = prometheus-postgresql-exporter
|
pkgbase = prometheus-postgresql-exporter
|
||||||
pkgdesc = Prometheus exporter for PostrgreSQL
|
pkgdesc = Prometheus exporter for PostrgreSQL
|
||||||
pkgver = 0.8.0
|
pkgver = 0.8.0
|
||||||
pkgrel = 1
|
pkgrel = 2
|
||||||
url = https://github.com/wrouesnel/postgres_exporter
|
url = https://github.com/wrouesnel/postgres_exporter
|
||||||
arch = x86_64
|
arch = x86_64
|
||||||
arch = i686
|
|
||||||
license = Apache
|
license = Apache
|
||||||
makedepends = git
|
makedepends = git
|
||||||
makedepends = go
|
makedepends = go
|
||||||
|
backup = etc/conf.d/prometheus-postgresql-exporter
|
||||||
source = https://github.com/wrouesnel/postgres_exporter/archive/v0.8.0.tar.gz
|
source = https://github.com/wrouesnel/postgres_exporter/archive/v0.8.0.tar.gz
|
||||||
source = prometheus-postgresql-exporter.service
|
source = prometheus-postgresql-exporter.service
|
||||||
|
source = prometheus-postgresql-exporter.conf
|
||||||
sha256sums = 27877c9b3aa751c7c1265f39986218f6a2c2b66a126cf348c6cc2f20f5201b02
|
sha256sums = 27877c9b3aa751c7c1265f39986218f6a2c2b66a126cf348c6cc2f20f5201b02
|
||||||
sha256sums = cda225c236df0e2a6d71c17a5390a92ed5cc7f71b8ca5843590c59fa02cdb135
|
sha256sums = 5eac41333fb12db676fed18c02156cfdefee957154241b4c724718fd40d23212
|
||||||
|
sha256sums = 5436ad34fbcd6faab69da8675631f3eb5b89d964682eb23164bf4bb816ad1897
|
||||||
|
|
||||||
pkgname = prometheus-postgresql-exporter
|
pkgname = prometheus-postgresql-exporter
|
||||||
|
|
||||||
|
|
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -1,5 +0,0 @@
|
||||||
*
|
|
||||||
!PKGBUILD
|
|
||||||
!.SRCINFO
|
|
||||||
!.gitignore
|
|
||||||
!prometheus-postgresql-exporter.service
|
|
23
PKGBUILD
23
PKGBUILD
|
@ -1,20 +1,24 @@
|
||||||
# Maintainer: Nils Czernia <nils@czserver.de>
|
# Maintainer: Manuel Hüsers <aur@huesers.de>
|
||||||
|
# Contributor: Nils Czernia <nils@czserver.de>
|
||||||
|
|
||||||
pkgname=prometheus-postgresql-exporter
|
pkgname=prometheus-postgresql-exporter
|
||||||
pkgver=0.8.0
|
pkgver=0.8.0
|
||||||
pkgrel=1
|
pkgrel=2
|
||||||
pkgdesc="Prometheus exporter for PostrgreSQL"
|
pkgdesc="Prometheus exporter for PostrgreSQL"
|
||||||
arch=('x86_64' 'i686')
|
arch=('x86_64')
|
||||||
url="https://github.com/wrouesnel/postgres_exporter"
|
url="https://github.com/wrouesnel/postgres_exporter"
|
||||||
license=('Apache')
|
license=('Apache')
|
||||||
makedepends=('git' 'go')
|
makedepends=('git' 'go')
|
||||||
|
backup=('etc/conf.d/prometheus-postgresql-exporter')
|
||||||
source=("https://github.com/wrouesnel/postgres_exporter/archive/v${pkgver}.tar.gz"
|
source=("https://github.com/wrouesnel/postgres_exporter/archive/v${pkgver}.tar.gz"
|
||||||
"prometheus-postgresql-exporter.service")
|
"prometheus-postgresql-exporter.service"
|
||||||
|
"prometheus-postgresql-exporter.conf")
|
||||||
sha256sums=('27877c9b3aa751c7c1265f39986218f6a2c2b66a126cf348c6cc2f20f5201b02'
|
sha256sums=('27877c9b3aa751c7c1265f39986218f6a2c2b66a126cf348c6cc2f20f5201b02'
|
||||||
'cda225c236df0e2a6d71c17a5390a92ed5cc7f71b8ca5843590c59fa02cdb135')
|
'5eac41333fb12db676fed18c02156cfdefee957154241b4c724718fd40d23212'
|
||||||
|
'5436ad34fbcd6faab69da8675631f3eb5b89d964682eb23164bf4bb816ad1897')
|
||||||
|
|
||||||
prepare() {
|
prepare() {
|
||||||
cd "${srcdir}/postgres_exporter-${pkgver}"
|
cd "postgres_exporter-${pkgver}"
|
||||||
|
|
||||||
export GOPATH="${srcdir}/gopath"
|
export GOPATH="${srcdir}/gopath"
|
||||||
mkdir -p "${GOPATH}/src/github.com/wrouesnel"
|
mkdir -p "${GOPATH}/src/github.com/wrouesnel"
|
||||||
|
@ -34,8 +38,11 @@ check() {
|
||||||
}
|
}
|
||||||
|
|
||||||
package() {
|
package() {
|
||||||
cd "${srcdir}/postgres_exporter-${pkgver}"
|
install -Dm644 "prometheus-postgresql-exporter.service" \
|
||||||
|
"${pkgdir}/usr/lib/systemd/system/prometheus-postgresql-exporter.service"
|
||||||
|
install -Dm644 "prometheus-postgresql-exporter.conf" \
|
||||||
|
"${pkgdir}/etc/conf.d/prometheus-postgresql-exporter"
|
||||||
|
|
||||||
|
cd "postgres_exporter-${pkgver}"
|
||||||
install -Dm755 "postgres_exporter" "${pkgdir}/usr/bin/prometheus_postgresql_exporter"
|
install -Dm755 "postgres_exporter" "${pkgdir}/usr/bin/prometheus_postgresql_exporter"
|
||||||
install -Dm755 "${srcdir}/prometheus-postgresql-exporter.service" "${pkgdir}/usr/lib/systemd/system/prometheus-postgresql-exporter.service"
|
|
||||||
}
|
}
|
||||||
|
|
2
prometheus-postgresql-exporter.conf
Normal file
2
prometheus-postgresql-exporter.conf
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
DATA_SOURCE_NAME=""
|
||||||
|
POSTGRES_EXPORTER_ARGS=""
|
|
@ -2,8 +2,24 @@
|
||||||
Description=Prometheus exporter for PostgreSQL
|
Description=Prometheus exporter for PostgreSQL
|
||||||
After=network.target
|
After=network.target
|
||||||
|
|
||||||
[Service]
|
EnvironmentFile=-/etc/conf.d/prometheus-postgresql-exporter
|
||||||
ExecStart=/usr/bin/prometheus_postgresql_exporter
|
ExecStart=/usr/bin/prometheus_postgresql_exporter $POSTGRES_EXPORTER_ARGS
|
||||||
|
Restart=on-failure
|
||||||
|
|
||||||
|
DynamicUser=true
|
||||||
|
ProtectKernelModules=true
|
||||||
|
ProtectKernelTunables=true
|
||||||
|
LockPersonality=true
|
||||||
|
ProtectHostname=true
|
||||||
|
ProtectHome=true
|
||||||
|
ProtectClock=true
|
||||||
|
ProtectControlGroups=true
|
||||||
|
ProtectKernelLogs=true
|
||||||
|
PrivateDevices=true
|
||||||
|
PrivateUsers=true
|
||||||
|
RestrictRealtime=true
|
||||||
|
CapabilityBoundingSet=
|
||||||
|
MemoryDenyWriteExecute=true
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
Loading…
Reference in a new issue