mirror of
https://github.com/gentoo-mirror/guru.git
synced 2025-04-18 23:39:00 -04:00
net-im/eturnal: add new openrc init file
"eturnalctl daemon" is very unreliable, and also I forgot slot operator on Erlang. Signed-off-by: Anna (cybertailor) Vyalkova <cyber+gentoo@sysrq.in>
This commit is contained in:
parent
a31e7776e5
commit
5d422846d2
@ -18,7 +18,7 @@ KEYWORDS="~amd64"
|
||||
|
||||
DEPEND="
|
||||
acct-user/eturnal
|
||||
>=dev-lang/erlang-21[ssl]
|
||||
>=dev-lang/erlang-21:=[ssl]
|
||||
dev-libs/libyaml
|
||||
dev-libs/openssl:=
|
||||
>=dev-erlang/conf-0.1
|
||||
@ -42,7 +42,6 @@ src_configure() {
|
||||
export CODE_LOADING=dynamic
|
||||
|
||||
export SKIP_DEPS=true
|
||||
|
||||
rebar3_src_configure
|
||||
}
|
||||
|
||||
@ -51,7 +50,7 @@ rebar3_install_release() {
|
||||
cp -pR bin lib releases "${ED}"/opt/eturnal/ || die
|
||||
|
||||
systemd_dounit etc/systemd/system/eturnal.service
|
||||
newinitd etc/openrc/eturnal.initd eturnal
|
||||
newinitd "${FILESDIR}"/eturnal.initd eturnal
|
||||
newconfd etc/openrc/eturnal.confd eturnal
|
||||
|
||||
insinto /etc
|
46
net-im/eturnal/files/eturnal.initd
Normal file
46
net-im/eturnal/files/eturnal.initd
Normal file
@ -0,0 +1,46 @@
|
||||
#!/sbin/openrc-run
|
||||
# shellcheck shell=sh
|
||||
#
|
||||
# Copyright 2024 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
extra_started_commands="reload"
|
||||
command="/usr/sbin/eturnalctl"
|
||||
command_args="foreground"
|
||||
command_user="eturnal:turnserver"
|
||||
command_background=1
|
||||
pidfile="/run/eturnal.pid"
|
||||
capabilities="^cap_net_bind_service"
|
||||
healthcheck_delay=300
|
||||
healthcheck_timer=60
|
||||
|
||||
depend() {
|
||||
need epmd net
|
||||
after firewall
|
||||
}
|
||||
|
||||
healthcheck() {
|
||||
"${command}" ping >/dev/null
|
||||
}
|
||||
|
||||
start_post() {
|
||||
local i=10
|
||||
while [ $((i = i - 1)) -gt 0 ]; do
|
||||
healthcheck && return 0
|
||||
sleep 1
|
||||
done
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
stop() {
|
||||
ebegin "Stopping ${RC_SVCNAME}"
|
||||
"${command}" stop
|
||||
eend $?
|
||||
}
|
||||
|
||||
reload() {
|
||||
ebegin "Reloading ${RC_SVCNAME}"
|
||||
"${command}" reload
|
||||
eend $?
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user