0584635a4e
As stated by the upstream developers, Prosody only supports lua-5.1 or luajit (which is a lua-5.1 interpreter): > Response from zash at zash.se: > >> I pegged the package to lua 5,1 based on the contents of the >> INSTALL file. Is this a hard requirement? > > Up until Prosody 0.9 Lua 5.1 is required. However LuaJIT > implements Lua 5.1 so it works. The license terms are not very consistent: the source files all state to be "MIT/X11 licensed" and defer to the COPYING file for details, but that file only has the text for the MIT license. Thus, we believe the license to be MIT/X11, as stated in the source files. This installs the base system with certificates for two domains: localhost and example.com The default runtime configuration is tweaked during installation to properly setup logging and pid-file directories. Prosody doesn't like being executed as root, and thus the daemon is executed as the user prosody. The startup script creates the pid file write location with appropriate permissions. Signed-off-by: Dushara Jayasinghe <nidujay@gmail.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
45 lines
977 B
Bash
45 lines
977 B
Bash
#! /bin/sh
|
|
|
|
NAME=prosody
|
|
DAEMON=/usr/bin/$NAME
|
|
|
|
# This must match the pidfile field in
|
|
# /etc/prosody/prosody.cfg.lua
|
|
|
|
PIDDIR=/var/run/$NAME
|
|
PIDFILE=$PIDDIR/$NAME.pid
|
|
|
|
# Gracefully exit if the package has been removed.
|
|
test -x $DAEMON || exit 0
|
|
|
|
case "$1" in
|
|
start)
|
|
printf "Starting $NAME: "
|
|
mkdir -p $PIDDIR
|
|
chown $NAME:$NAME $PIDDIR
|
|
start-stop-daemon -S -q -o -x $DAEMON -c $NAME
|
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
|
;;
|
|
stop)
|
|
printf "Stopping $NAME: "
|
|
# The standard method of identifying the name doesn't
|
|
# work as the process name is lua. So use the pidfile
|
|
# which is created by the service itself as a match
|
|
# criteria when stopping the service
|
|
start-stop-daemon -K -q -o -p "$PIDFILE"
|
|
[ $? = 0 ] && echo "OK" || echo "FAIL"
|
|
;;
|
|
restart|reload)
|
|
echo "Restarting $NAME: "
|
|
$0 stop
|
|
sleep 1
|
|
$0 start
|
|
;;
|
|
*)
|
|
echo "Usage: $0 {start|stop|restart|reload}" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|