Tom
unread,Apr 18, 2021, 5:38:20 PM4/18/21Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Prosody IM Users Group, Prosody IM Developers Group
Hello. I wanted to share my OpenRC example init script I made with
other prosody users that might find it useful if they are also running
OpenRC on their servers. I also think it would be useful to package
this script in the /usr/share/doc/prosody/ folder. Not this one
exactly, but a proper one I could send that uses tabs. I'm not sure my
formatting will come through properly on email.
# cat /etc/init.d/prosody
#!/usr/sbin/openrc-run
description="Prosody XMPP server"
extra_started_commands="reload signal healthcheck debug"
extra_commands="checkconfig"
command="/usr/bin/prosody"
commandctl="/usr/bin/prosodyctl"
command_args="--config ${PROSODY_CONFIG:-/etc/prosody/prosody.cfg.lua}"
command_args_foreground="-F"
command_user="${PROSODY_USER:-prosody}"
supervisor="supervise-daemon"
healthcheck_timer=10
healthcheck_delay=25
healthcheck() {
/usr/lib/nagios/plugins/check_http -H www.example.tld -I [::1]
-u /host_status_check -p 5280 return $?
}
unhealthy() { debug }
checkconfig() {
${commandctl} check config
return $?
}
reload() {
checkconfig || return 1
ebegin "Reloading configuration"
${supervisor} ${RC_SVCNAME} --signal HUP
eend $?
}
signal() {
ebegin "Reloading configuration"
${supervisor} ${RC_SVCNAME} --signal SIGUSR1
eend $?
}
debug() {
ebegin "Dumping debug ringbuffer"
${supervisor} ${RC_SVCNAME} --signal SIGUSR2
eend $?
}
start_pre() {
checkconfig || return 1
checkpath -d -m 0750 -o "${PROSODY_USER:-prosody}" -q
/var/log/prosody checkpath -d -m 0750 -o
"${PROSODY_USER:-prosody}":adm -q /run/prosody
}
--
_________________________________________
/ Superior ability breeds superior \
| ambition. |
| |
\ -- Spock, "Space Seed", stardate 3141.9 /
-----------------------------------------
\
\
/\ /\
//\\_//\\ ____
\_ _/ / /
/ * * \ /^^^]
\_\O/_/ [ ]
/ \_ [ /
\ \_ / /
[ [ / \/ _/
_[ [ \ /_/