/etc/init.d/prosody is in prosody 0.9.10-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | #! /bin/sh
### BEGIN INIT INFO
# Provides: prosody
# Required-Start: $network $local_fs $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Prosody XMPP Server
### END INIT INFO
set -e
# /etc/init.d/prosody: start and stop Prosody XMPP server
USER=prosody
DAEMON=/usr/bin/prosody
PIDPATH=/var/run/prosody
PIDFILE="$PIDPATH"/prosody.pid
NICE=
MAXFDS=
CPUSCHED=
IOSCHED=
test -x "$DAEMON" || exit 0
. /lib/lsb/init-functions
if [ -f /etc/default/prosody ] ; then
. /etc/default/prosody
fi
start_opts() {
test -z "$NICE" || echo -n " --nicelevel $NICE"
test -z "$CPUSCHED" || echo -n " --procsched $CPUSCHED"
test -z "$IOSCHED" || echo -n " --iosched $IOSCHED"
}
start_prosody () {
mkdir -p `dirname $PIDFILE`
chown prosody:adm `dirname $PIDFILE`
if start-stop-daemon --start --quiet --pidfile "$PIDFILE" \
--chuid "$USER" --oknodo --user "$USER" --name lua5.1 \
$(start_opts) --startas "$DAEMON";
then
return 0
else
return 1
fi
}
stop_prosody () {
if start-stop-daemon --stop --quiet --retry 30 \
--oknodo --pidfile "$PIDFILE" --user "$USER" --name lua5.1;
then
return 0
else
return 1
fi
}
signal_prosody () {
if start-stop-daemon --stop --quiet --pidfile "$PIDFILE" \
--user "$USER" --name lua5.1 --oknodo --signal $1;
then
return 0
else
return 1
fi
}
case "$1" in
start)
log_daemon_msg "Starting Prosody XMPP Server" "prosody"
if start_prosody; then
log_end_msg 0;
else
log_end_msg 1;
fi
;;
stop)
log_daemon_msg "Stopping Prosody XMPP Server" "prosody"
if stop_prosody; then
log_end_msg 0;
else
log_end_msg 1;
fi
;;
force-reload|restart)
log_daemon_msg "Restarting Prosody XMPP Server" "prosody"
stop_prosody
if start_prosody; then
log_end_msg 0;
else
log_end_msg 1;
fi
;;
reload)
log_daemon_msg "Reloading Prosody XMPP Server" "prosody"
if signal_prosody 1; then
log_end_msg 0;
else
log_end_msg 1;
fi
;;
status)
log_daemon_msg "Status of Prosody XMPP Server" "prosody "
status_of_proc -p"$PIDFILE" lua5.1
;;
*)
log_action_msg "Usage: /etc/init.d/prosody {start|stop|restart|reload|status}"
exit 1
esac
exit 0
|