2019-12-31 18:21:19 +01:00
|
|
|
#!/sbin/openrc-run
|
2020-04-23 19:20:30 +02:00
|
|
|
# Copyright 2019-2020 Gentoo Authors
|
2019-12-31 18:21:19 +01:00
|
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
|
|
|
|
name="routinator daemon"
|
|
|
|
description="An RPKI relying party software"
|
|
|
|
command=/usr/bin/routinator
|
2024-12-16 11:55:42 +01:00
|
|
|
command_args="--syslog --config /etc/routinator.conf --repository-dir=${ROUTINATOR_BASEDIR}/repository server
|
2019-12-31 22:33:49 +01:00
|
|
|
${ROUTINATOR_OPTS}"
|
2020-01-04 11:59:01 +01:00
|
|
|
pidfile="/run/${RC_SVCNAME}.pid"
|
|
|
|
command_args_background="--detach --pid-file=${pidfile}"
|
2019-12-31 18:21:19 +01:00
|
|
|
|
|
|
|
depend() {
|
|
|
|
need net
|
|
|
|
}
|
|
|
|
|
|
|
|
start_pre() {
|
2020-04-23 19:20:30 +02:00
|
|
|
checkpath -d -m 0750 -o routinator:routinator "${ROUTINATOR_BASEDIR}"
|
2019-12-31 18:21:19 +01:00
|
|
|
if [ ! -d "${ROUTINATOR_BASEDIR}/repository" ] || \
|
2019-12-31 22:33:49 +01:00
|
|
|
[ ! -d "${ROUTINATOR_BASEDIR}/tals" ]; then
|
2024-12-16 11:21:46 +01:00
|
|
|
${command} --repository-dir=${ROUTINATOR_BASEDIR}/repository init \
|
2019-12-31 22:33:49 +01:00
|
|
|
--decline-arin-rpa
|
2020-04-23 19:20:30 +02:00
|
|
|
chown -R routinator:routinator "${ROUTINATOR_BASEDIR}"/repository
|
|
|
|
chown -R routinator:routinator "${ROUTINATOR_BASEDIR}"/tals
|
2019-12-31 18:21:19 +01:00
|
|
|
fi
|
|
|
|
}
|