aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2021-01-08 13:37:51 +0100
committerJakub Jirutka <jakub@jirutka.cz>2021-01-08 13:43:29 +0100
commitfdeaf47b6f8d7cbf234b835888e59833f2642221 (patch)
tree04d481d680043539e9df432af75b02b0619591d4
parentd6bfe67829142a385b1da78419edd407c90cc450 (diff)
downloadaports-fdeaf47b6f8d7cbf234b835888e59833f2642221.tar.gz
aports-fdeaf47b6f8d7cbf234b835888e59833f2642221.tar.bz2
aports-fdeaf47b6f8d7cbf234b835888e59833f2642221.tar.xz
main/mosquitto: don't force supervise-daemon and make config required
supervise-daemon is still experimental, has bad defaults and tends to be unreliable. Users can enable supervise-daemon, if they want to, simply by declaring `supervisor=supervise-daemon` in /etc/conf.d/mosquitto. See my mail from Tue, 15 Dec 2020 15:33:16 +0100 in alpine-devel mailing-list in topic "Use of supervise-daemon in Alpine". (I cannot simply reference it from ML archive because it's broken.) This partially reverts 61c0b8e50e720acc163e9043fbfac7655a18a083. I don't understand why the mosquitto config file was optional before, it doesn't make much sense.
-rw-r--r--main/mosquitto/APKBUILD10
-rw-r--r--main/mosquitto/mosquitto.confd10
-rw-r--r--main/mosquitto/mosquitto.initd17
3 files changed, 24 insertions, 13 deletions
diff --git a/main/mosquitto/APKBUILD b/main/mosquitto/APKBUILD
index eebfdd176d..bb5aecadfd 100644
--- a/main/mosquitto/APKBUILD
+++ b/main/mosquitto/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mosquitto
pkgver=1.6.12
-pkgrel=1
+pkgrel=2
pkgdesc="An open source MQTT broker"
url="https://mosquitto.org/"
arch="all"
@@ -17,7 +17,9 @@ subpackages="$pkgname-dbg $pkgname-dev $pkgname-doc $pkgname-libs++:_pp $pkgname
source="http://mosquitto.org/files/source/mosquitto-$pkgver.tar.gz
config.patch
disable-ci-tests.patch
- mosquitto.initd"
+ mosquitto.initd
+ mosquitto.confd
+ "
# secfixes:
# 1.6.7-r0:
@@ -69,6 +71,7 @@ package() {
"$pkgdir"/etc/mosquitto/mosquitto.conf
install -Dm755 "$srcdir"/mosquitto.initd "$pkgdir"/etc/init.d/mosquitto
+ install -Dm755 "$srcdir"/mosquitto.confd "$pkgdir"/etc/conf.d/mosquitto
}
_pp() {
@@ -90,4 +93,5 @@ clients() {
sha512sums="68cd2e4aa14254c0332ad78eac1f885e0e4e9f2332540d3778b8c7df096db7618b8467b5bb25f70ddc3306d01dd36eb9a9e2bf2738da77e196c7a1ccaed869d2 mosquitto-1.6.12.tar.gz
fb000f9fa1ef94cbf3811a23b5692c0c8f9e2df945959cef6005462715e99d6f75cf6b31bd496271ffc17634024aed986771a73962fef865c0d386f6c194fb33 config.patch
21df2006a5eb9e1248cf261e555ded8e80e79f2a2d2a55b1f8a153af7c0feb867f3b3bd71efbe4d8569e3031c65f3e144794724f012e7539244a9bd97b6b6bb3 disable-ci-tests.patch
-d5406c258351133d85fc90056d78286a0ed1defde90e68d84fa9a1d65244d2baef76fd30fd04855e4bf6fc87532ef8ff274a6b70564f09f69fc6d14b5106fef0 mosquitto.initd"
+a527813957b6f2d7afdb7269bade61d99b3023a147861b38902971929ff342a7c8c276bdb808fcfe7e48fa3e5c7521a16d777e5a3313256b8bf1e759cec5b7b0 mosquitto.initd
+678a8aaefb9181f5f4998304046e5a8737049f90cf6bbbfd5fd4549592728afe77cb536547b39ad1598d53fe0b7c03e1506b2683e7b936712b9fad4a317f4b43 mosquitto.confd"
diff --git a/main/mosquitto/mosquitto.confd b/main/mosquitto/mosquitto.confd
new file mode 100644
index 0000000000..d4ee25e710
--- /dev/null
+++ b/main/mosquitto/mosquitto.confd
@@ -0,0 +1,10 @@
+# Configuration file for /etc/init.d/mosquitto
+
+# Path to the mosquitto configuration file.
+#cfgfile="/etc/mosquitto/${RC_SVCNAME#mosquitto.}.conf"
+
+# Additional arguments to pass to the mosquitto program.
+#command_args=
+
+# Uncomment to use process supervisor.
+#supervisor="supervise-daemon"
diff --git a/main/mosquitto/mosquitto.initd b/main/mosquitto/mosquitto.initd
index 2e7830030d..7299ab2cd3 100644
--- a/main/mosquitto/mosquitto.initd
+++ b/main/mosquitto/mosquitto.initd
@@ -1,17 +1,14 @@
#!/sbin/openrc-run
-supervisor=supervise-daemon
-
name="Mosquitto message broker"
description="MQTT v3.1.1 Message Broker"
-command="/usr/sbin/mosquitto"
-command_args="$mosquitto_args"
+: ${cfgfile:="/etc/mosquitto/${RC_SVCNAME#mosquitto.}.conf"}
-config=/etc/mosquitto/${RC_SVCNAME#mosquitto.}.conf
+command="/usr/sbin/mosquitto"
+# mosquitto_args is here for backward compatibility only
+command_args="-c $cfgfile ${command_args:-$mosquitto_args}"
+command_background="yes"
+pidfile="/run/$RC_SVCNAME.pid"
-start_pre() {
- if [ -f $config ]; then
- command_args="-c $config $command_args"
- fi
-}
+required_files="$cfgfile"