aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2021-09-03 23:25:44 +0200
committerJakub Jirutka <jakub@jirutka.cz>2021-09-03 23:26:31 +0200
commit9c421b633cbb7ec5a46d0e871cf6556c19244ee3 (patch)
tree4ee0904c74004edbed1a1974f78babac6ba8aa80
parent3574591dd360ce07bbb7da246d688c95324a8b74 (diff)
downloadaports-9c421b633cbb7ec5a46d0e871cf6556c19244ee3.tar.gz
aports-9c421b633cbb7ec5a46d0e871cf6556c19244ee3.tar.bz2
aports-9c421b633cbb7ec5a46d0e871cf6556c19244ee3.tar.xz
community/repmgr: replace sudo with doas
-rw-r--r--community/repmgr/APKBUILD16
-rw-r--r--community/repmgr/repmgr.conf.patch12
-rw-r--r--community/repmgr/repmgr.doasd4
-rw-r--r--community/repmgr/repmgr.sudoers4
4 files changed, 19 insertions, 17 deletions
diff --git a/community/repmgr/APKBUILD b/community/repmgr/APKBUILD
index fcab854ec0..6b9f0085ae 100644
--- a/community/repmgr/APKBUILD
+++ b/community/repmgr/APKBUILD
@@ -2,12 +2,12 @@
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=repmgr
pkgver=5.2.1
-pkgrel=1
+pkgrel=2
pkgdesc="Replication Manager for PostgreSQL"
url="http://www.repmgr.org/"
arch="all"
license="GPL-3.0"
-depends="cmd:ssh postgresql-client sudo"
+depends="cmd:ssh doas postgresql-client"
makedepends="postgresql-dev flex libxml2-dev libedit-dev"
pkgusers="postgres"
pkggroups="postgres"
@@ -15,7 +15,7 @@ subpackages="$pkgname-doc $pkgname-daemon"
source="$pkgname-$pkgver.tar.gz::https://github.com/2ndQuadrant/repmgr/archive/v$pkgver.tar.gz
repmgr.conf.patch
repmgrd.initd
- repmgr.sudoers
+ repmgr.doasd
"
build() {
@@ -39,7 +39,7 @@ package() {
mkdir -p usr/share/doc/$pkgname
cp "$builddir"/*.md "$builddir"/doc/*.md usr/share/doc/$pkgname/
- install -D -m 600 "$srcdir"/repmgr.sudoers etc/sudoers.d/$pkgname
+ install -D -m 600 "$srcdir"/repmgr.doasd etc/doas.d/$pkgname.conf
}
daemon() {
@@ -52,7 +52,9 @@ daemon() {
install -D -m 755 "$srcdir"/repmgrd.initd "$subpkgdir"/etc/init.d/repmgrd
}
-sha512sums="609ca27322087a042ede3a54565e425e9f39d74df510cbc103390cf60a31b35ce311cd942d5efd062bec2026864bd45466dbaf323963060d3ce89ce167c2a0b1 repmgr-5.2.1.tar.gz
-ce16af48eff1ac7a54281f7a7b184b15aa4841b190a4b83024657ddb8d12c3fa91976d815f93d64f4ef255d9a710493d5a2f75c509f891d020f3a35e9fb05df3 repmgr.conf.patch
+sha512sums="
+609ca27322087a042ede3a54565e425e9f39d74df510cbc103390cf60a31b35ce311cd942d5efd062bec2026864bd45466dbaf323963060d3ce89ce167c2a0b1 repmgr-5.2.1.tar.gz
+a35975496b208424fb160e9d7d93b787c9b53070b6c795a892f437d5cadf25a67202052d9b4bcfa463ff970e0654fbe687bba57c6c08e369e1c3b8642557538a repmgr.conf.patch
988d68205290aef2f1f63281d2dc7da7267ba2738d44a8908b0506e968d8acd895c03d9ee821d7ef5d240ec82b67e51fdfb2d9219e71237c1b0aa3f458ad134b repmgrd.initd
-1542e6742b01b9d780ab7d9bd81b1c7e134cdf2dcd234e10704273e34c3f7ee8f87cf4f07cdc22d8a10e0f1dcef605f50ccaada09c3f1ee10267477443ce3e78 repmgr.sudoers"
+bf2de989323712ee595607a5394bbd0fbadec88d2e46744f6d0b8fce142cf93630868ec7f7108866ca2beb6b29a6999f87fd04fe4d88fa33919f1cd7fc2c76fa repmgr.doasd
+"
diff --git a/community/repmgr/repmgr.conf.patch b/community/repmgr/repmgr.conf.patch
index 76f121d88a..b6b7b3f09e 100644
--- a/community/repmgr/repmgr.conf.patch
+++ b/community/repmgr/repmgr.conf.patch
@@ -46,10 +46,10 @@
-#service_stop_command = ''
-#service_restart_command = ''
-#service_reload_command = ''
-+service_start_command = 'sudo /etc/init.d/postgresql start'
-+service_stop_command = 'sudo /etc/init.d/postgresql stop'
-+service_restart_command = 'sudo /etc/init.d/postgresql restart'
-+service_reload_command = 'sudo /etc/init.d/postgresql reload'
++service_start_command = 'doas -n /etc/init.d/postgresql start'
++service_stop_command = 'doas -n /etc/init.d/postgresql stop'
++service_restart_command = 'doas -n /etc/init.d/postgresql restart'
++service_reload_command = 'doas -n /etc/init.d/postgresql reload'
#service_promote_command = '' # This parameter is intended for systems which provide a
# package-level promote command, such as Debian's
# "pg_ctlcluster". *IMPORTANT*: it is *not* a substitute
@@ -59,8 +59,8 @@
#
-#repmgrd_service_start_command = ''
-#repmgrd_service_stop_command = ''
-+repmgrd_service_start_command = 'sudo /etc/init.d/repmgrd start'
-+repmgrd_service_stop_command = 'sudo /etc/init.d/repmgrd stop'
++repmgrd_service_start_command = 'doas -n /etc/init.d/repmgrd start'
++repmgrd_service_stop_command = 'doas -n /etc/init.d/repmgrd stop'
#------------------------------------------------------------------------------
# Status check thresholds
diff --git a/community/repmgr/repmgr.doasd b/community/repmgr/repmgr.doasd
new file mode 100644
index 0000000000..8a263ea28c
--- /dev/null
+++ b/community/repmgr/repmgr.doasd
@@ -0,0 +1,4 @@
+# Rules for repmgr and repmgrd. Installed by package repmgr.
+
+permit nopass postgres as root cmd /etc/init.d/postgresql
+permit nopass postgres as root cmd /etc/init.d/repmgrd
diff --git a/community/repmgr/repmgr.sudoers b/community/repmgr/repmgr.sudoers
deleted file mode 100644
index a1f9f6a500..0000000000
--- a/community/repmgr/repmgr.sudoers
+++ /dev/null
@@ -1,4 +0,0 @@
-# Rules for repmgr and repmgrd installed by package repmgr.
-
-Defaults:postgres !requiretty
-postgres ALL=(root) NOPASSWD: /etc/init.d/postgresql, /etc/init.d/repmgrd