summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-im/prosody/files/prosody.initd-r6')
-rw-r--r--net-im/prosody/files/prosody.initd-r646
1 files changed, 46 insertions, 0 deletions
diff --git a/net-im/prosody/files/prosody.initd-r6 b/net-im/prosody/files/prosody.initd-r6
new file mode 100644
index 000000000000..e4138c597b23
--- /dev/null
+++ b/net-im/prosody/files/prosody.initd-r6
@@ -0,0 +1,46 @@
+#!/sbin/openrc-run
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+extra_started_commands="reload"
+name="Prosody XMPP server"
+prosody_config="/etc/prosody/prosody.cfg.lua"
+prosody_data="/var/lib/prosody"
+prosody_logs="/var/log/prosody"
+prosody_pid="/run/prosody"
+pidfile="${prosody_pid}/prosody.pid"
+
+command="/usr/bin/prosody"
+command_args="--daemonize"
+commandctl="/usr/bin/prosodyctl"
+command_group="prosody"
+command_user="prosody"
+
+checkconfig() {
+ if [ ! -f "${prosody_config}" ]; then
+ eerror "Please create ${prosody_config} before starting Prosody!"
+ return 1
+ fi
+
+ ${commandctl} check config
+ return $?
+}
+
+depend() {
+ need net
+ use dns postgresql
+}
+
+reload() {
+ ebegin "Reloading configuration"
+ start-stop-daemon --signal HUP --pidfile "${pidfile}"
+ eend $?
+}
+
+start_pre() {
+ checkconfig || return 1
+
+ checkpath -d -m 0750 -o "${command_user}:${command_group}" -q "${prosody_data}"
+ checkpath -d -m 0750 -o "${command_user}:${command_group}" -q "${prosody_logs}"
+ checkpath -d -m 0750 -o "${command_user}:${command_group}" -q "${prosody_pid}"
+}