You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/net-im/prosody/files/prosody.initd

48 lines
1.2 KiB

#!/sbin/runscript
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-im/prosody/files/prosody.initd,v 1.2 2012/11/27 09:20:26 klausman Exp $
description="Prosody is a server for Jabber/XMPP written in Lua."
description_reload="Reload configuration and reopen log files."
extra_started_commands="reload"
PIDFILE="/var/run/jabber/prosody.pid"
USER="jabber"
COMMAND="/usr/bin/prosody"
depend() {
use dns
need net
provide jabber-server
}
checkconfig() {
if [ ! -e /etc/jabber/prosody.cfg.lua ] ; then
eerror "You need a /etc/jabber/prosody.cfg.lua file to run prosody"
return 1
fi
}
start() {
checkconfig || return 1
checkpath -q -d -m 0770 -o jabber:jabber /var/run/jabber
ebegin "Starting Prosody XMPP Server"
start-stop-daemon --start -b --pidfile ${PIDFILE} \
--make-pidfile --user ${USER} --exec ${COMMAND}
eend $?
}
stop() {
ebegin "Stopping Prosody XMPP Server"
start-stop-daemon --stop --pidfile ${PIDFILE} \
--user ${USER} --exec ${COMMAND}
eend $?
}
reload() {
ebegin "Reloading configuration of Prosody XMPP Server"
start-stop-daemon --pidfile ${PIDFILE} --signal HUP
eend $?
}