aboutsummaryrefslogtreecommitdiffstats
path: root/community/prosody/prosody.initd
diff options
context:
space:
mode:
authorFrancesco Colista <fcolista@alpinelinux.org>2016-08-22 07:32:16 +0000
committerFrancesco Colista <fcolista@alpinelinux.org>2016-08-22 07:32:16 +0000
commit749d2e684cbb034cff718ca48dd8beb2e99151b6 (patch)
tree016d293ca82ab177bf4dee33c44d326ece430e66 /community/prosody/prosody.initd
parent73dba6909782bbc75c29e3da183844320f43e06d (diff)
downloadaports-749d2e684cbb034cff718ca48dd8beb2e99151b6.tar.bz2
aports-749d2e684cbb034cff718ca48dd8beb2e99151b6.tar.xz
community/prosody: moved from testing
Diffstat (limited to 'community/prosody/prosody.initd')
-rw-r--r--community/prosody/prosody.initd47
1 files changed, 47 insertions, 0 deletions
diff --git a/community/prosody/prosody.initd b/community/prosody/prosody.initd
new file mode 100644
index 0000000000..c0557bd812
--- /dev/null
+++ b/community/prosody/prosody.initd
@@ -0,0 +1,47 @@
+#!/sbin/openrc-run
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+description="Prosody is a server for prosody/XMPP written in Lua."
+description_reload="Reload configuration and reopen log files."
+extra_started_commands="reload"
+pidfile="/var/run/prosody/prosody.pid"
+
+depend() {
+ use dns
+ need net
+ provide prosody-server
+}
+
+checkconfig() {
+ if [ ! -e /etc/prosody/prosody.cfg.lua ] ; then
+ eerror "You need a /etc/prosody/prosody.cfg.lua file to run prosody"
+ return 1
+ fi
+ luac -p /etc/prosody/prosody.cfg.lua
+ return $?
+}
+
+start() {
+ checkconfig || return 1
+ checkpath -q -d -m 0770 -o prosody:prosody "$(dirname ${pidfile})"
+ checkpath -q -f -m 0770 -o prosody:prosody "${pidfile}"
+ checkpath -q -d -m 0750 -o prosody:prosody /var/log/prosody
+ ebegin "Starting Prosody XMPP Server"
+ prosodyctl start
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping Prosody XMPP Server"
+ prosodyctl stop
+ eend $?
+}
+
+reload() {
+ checkconfig || return 1
+ ebegin "Reloading configuration of Prosody XMPP Server"
+ prosodyctl reload
+ eend $?
+}