Fix LavinMQ OpenRC data ownership
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# Maintainer: Joachim Schlöffel <me@joachim-schloeffel.com>
|
||||
pkgname=lavinmq
|
||||
pkgver=2.9.1
|
||||
pkgrel=0
|
||||
pkgrel=2
|
||||
pkgdesc="High-performance AMQP and MQTT message queue server"
|
||||
url="https://github.com/cloudamqp/lavinmq"
|
||||
arch="x86_64"
|
||||
@@ -23,6 +23,8 @@ makedepends="
|
||||
yaml-dev
|
||||
"
|
||||
install="$pkgname.pre-install"
|
||||
pkgusers="lavinmq"
|
||||
pkggroups="lavinmq"
|
||||
subpackages="
|
||||
$pkgname-doc
|
||||
$pkgname-openrc:_openrc:noarch
|
||||
@@ -52,6 +54,7 @@ package() {
|
||||
make DESTDIR="$pkgdir" install
|
||||
rm -r "$pkgdir"/lib/systemd "$pkgdir"/usr/lib/sysusers.d
|
||||
rmdir "$pkgdir"/lib "$pkgdir"/usr/lib
|
||||
install -d -m 0750 -o lavinmq -g lavinmq "$pkgdir"/var/lib/lavinmq
|
||||
}
|
||||
|
||||
_openrc() {
|
||||
@@ -67,5 +70,5 @@ _openrc() {
|
||||
sha512sums="
|
||||
5f88de7a1e093b1f6e2ead5c340140bd489a99ca8adfa9f40052148490d0bdf8ff1e2dad67727e9799ad1f942755df01525e63d24b0901684a743f43c42110b9 lavinmq-2.9.1.tar.gz
|
||||
62a609d50f28db960098c4c84ce4f1dad78413366a9a9aca18fe321114d687be3bf7b71924d4ace69bd74383c5ac40d2ee09ae0eef9c1bfe653b97448e42e110 lavinmq.confd
|
||||
76fbfa1b14c58631e92f817e689584239eb644e68460c091decdcabe7661aeb210f9128545262add2fb07eeee155c8734f1e612fc59ebb897d3c67e95a56350f lavinmq.initd
|
||||
1853196e70297b5c4a2207fde50df735620cf6d99c4994644fd676bffaf863d67300ad7ae771c4bbb86fce1a0485c2a7968cf912c5f5bb878e08b15e5a28ba1b lavinmq.initd
|
||||
"
|
||||
|
||||
@@ -18,9 +18,11 @@ depend() {
|
||||
}
|
||||
|
||||
start_pre() {
|
||||
checkpath -d -m 0755 -o "${LAVINMQ_USER:-lavinmq}:${LAVINMQ_GROUP:-lavinmq}" \
|
||||
local service_owner="${LAVINMQ_USER:-lavinmq}:${LAVINMQ_GROUP:-lavinmq}"
|
||||
|
||||
checkpath -d -m 0755 -o "$service_owner" \
|
||||
/run/lavinmq \
|
||||
/var/log/lavinmq
|
||||
checkpath -d -m 0750 -o "${LAVINMQ_USER:-lavinmq}:${LAVINMQ_GROUP:-lavinmq}" \
|
||||
"$data_dir"
|
||||
checkpath -d -m 0750 -o "$service_owner" "$data_dir"
|
||||
checkpath -f -m 0640 -o "$service_owner" "$data_dir"/.lock
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ test -x /usr/bin/lavinmqctl
|
||||
test -x /usr/bin/lavinmqperf
|
||||
test -f /etc/lavinmq/lavinmq.ini
|
||||
test -d /var/lib/lavinmq
|
||||
test "$(stat -c '%U:%G %a' /var/lib/lavinmq)" = "lavinmq:lavinmq 750"
|
||||
test -f /etc/conf.d/lavinmq
|
||||
test -f /etc/init.d/lavinmq
|
||||
test -f /usr/share/doc/lavinmq/README.md
|
||||
@@ -18,3 +19,14 @@ lavinmqperf --version
|
||||
|
||||
rc-update add lavinmq default || true
|
||||
test -L /etc/runlevels/default/lavinmq
|
||||
rc-service lavinmq start
|
||||
rc-service lavinmq status
|
||||
test -f /var/lib/lavinmq/.lock
|
||||
rc-service lavinmq stop
|
||||
|
||||
chown root:root /var/lib/lavinmq/.lock
|
||||
chmod 0600 /var/lib/lavinmq/.lock
|
||||
rc-service lavinmq start
|
||||
rc-service lavinmq status
|
||||
test "$(stat -c '%U:%G %a' /var/lib/lavinmq/.lock)" = "lavinmq:lavinmq 640"
|
||||
rc-service lavinmq stop
|
||||
|
||||
@@ -60,6 +60,7 @@ docker run --rm --platform "${platform}" \
|
||||
test -x /usr/bin/lavinmqperf
|
||||
test -f /etc/lavinmq/lavinmq.ini
|
||||
test -d /var/lib/lavinmq
|
||||
test "$(stat -c "%U:%G %a" /var/lib/lavinmq)" = "lavinmq:lavinmq 750"
|
||||
test -f /etc/conf.d/lavinmq
|
||||
test -f /etc/init.d/lavinmq
|
||||
test -f /usr/share/doc/lavinmq/README.md
|
||||
|
||||
Reference in New Issue
Block a user