summaryrefslogtreecommitdiff
path: root/chat
diff options
context:
space:
mode:
authorkhorben <khorben@pkgsrc.org>2022-07-25 04:47:06 +0000
committerkhorben <khorben@pkgsrc.org>2022-07-25 04:47:06 +0000
commit6b7e42d0efcc66083ebbb0c775afd9aef4430a59 (patch)
tree73bf0947bd540c480f85c4e6076423136b8d7ae9 /chat
parentf9c8238d954fc1174353fea36e25bafe21274a69 (diff)
downloadpkgsrc-6b7e42d0efcc66083ebbb0c775afd9aef4430a59.tar.gz
chat/prosody: always create the directory for the PID file
The RC script for prosody now always creates the corresponding sub-directory for prosody's PID file. This is inspired by the RC script for mdnsd in NetBSD, and for dbus in pkgsrc; thanks spz@ for the suggestion! Bumps PKGREVISION. Tested on NetBSD/amd64. XXX pull-up to pkgsrc-2022Q2 (completes request 6649)
Diffstat (limited to 'chat')
-rw-r--r--chat/prosody/Makefile6
-rw-r--r--chat/prosody/files/prosody.sh13
2 files changed, 15 insertions, 4 deletions
diff --git a/chat/prosody/Makefile b/chat/prosody/Makefile
index 4492bc4227e..f6565f8d98a 100644
--- a/chat/prosody/Makefile
+++ b/chat/prosody/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.39 2022/07/07 02:31:45 khorben Exp $
+# $NetBSD: Makefile,v 1.40 2022/07/25 04:47:06 khorben Exp $
DISTNAME= prosody-0.12.0
-PKGREVISION= 1
+PKGREVISION= 2
CATEGORIES= chat
MASTER_SITES= https://prosody.im/downloads/source/
@@ -71,6 +71,8 @@ MAKE_FILE= makefile
RCD_SCRIPTS= prosody
FILES_SUBST+= PROSODY_RUN=${PROSODY_RUN}
+FILES_SUBST+= PROSODY_USER=${PROSODY_USER}
+FILES_SUBST+= PROSODY_GROUP=${PROSODY_GROUP}
TEST_TARGET= test
diff --git a/chat/prosody/files/prosody.sh b/chat/prosody/files/prosody.sh
index d772edc1037..80bc248e513 100644
--- a/chat/prosody/files/prosody.sh
+++ b/chat/prosody/files/prosody.sh
@@ -1,6 +1,6 @@
#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: prosody.sh,v 1.4 2022/07/07 02:31:46 khorben Exp $
+# $NetBSD: prosody.sh,v 1.5 2022/07/25 04:47:06 khorben Exp $
#
# PROVIDE: prosody
# REQUIRE: DAEMON
@@ -14,9 +14,18 @@ rcvar=${name}
ctl_command="@PREFIX@/bin/${name}ctl"
required_files="@PKG_SYSCONFDIR@/${name}.cfg.lua"
pidfile="@PROSODY_RUN@/${name}.pid"
-#start_precmd="ulimit -n 2048"
+start_precmd="prosody_precmd"
extra_commands="reload status"
+prosody_precmd()
+{
+ if [ ! -d @PROSODY_RUN@ ]; then
+ @MKDIR@ -m 0755 @PROSODY_RUN@
+ fi
+ @CHOWN@ @PROSODY_USER@:@PROSODY_GROUP@ @PROSODY_RUN@
+ #ulimit -n 2048
+}
+
start_cmd="${ctl_command} start"
stop_cmd="${ctl_command} stop"
reload_cmd="${ctl_command} reload"