gentoo-ebuilds/app-crypt/onak/files/onak.init
Nicolas PARLANT 6f989d9086
app-crypt/onak: add 0.6.4
Use github tarball which includes debian files (service and logrotate).
Provide init scrips for OpenRC and systemd.

add onak user/group

Useflags reworked :
remove dynamic, shared-libs backends is now forced to make all backends
enabled available. Thus test and REQUIRED_USE are removed.
add daemon to handle the key daemon (was default)
add systemd for sd-bus

sed-op :
use a subdir for log and socket (permissions are easier)
make systemd conditional

Install all files which can be useful: logrotate, cgi-conf

Bugs fixed by upstream in this release.

Closes: https://bugs.gentoo.org/945057
Closes: https://bugs.gentoo.org/957412
Signed-off-by: Nicolas PARLANT <nicolas.parlant@parhuet.fr>
Part-of: https://github.com/gentoo/gentoo/pull/44065
Signed-off-by: Sam James <sam@gentoo.org>
2025-11-04 11:12:48 +00:00

38 lines
910 B
Text

#!/sbin/openrc-run
# Copyright 2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
: ${ONAK_CONFIG:=/etc/onak.ini}
: ${ONAK_GROUP:=onak}
: ${ONAK_USER:=onak}
name="onak"
description="Backend caching key daemon for onak OpenPGP keyserver"
command=/usr/sbin/onak-keyd
command_args="-f -c ${ONAK_CONFIG}"
command_user="${ONAK_USER}:${ONAK_GROUP}"
command_background=true
pidfile="/run/onak.pid"
start_pre() {
if ! grep -q -E '^use_keyd=*(true|yes|1)$' ${ONAK_CONFIG}; then
eerror "You must enable the keyd backend in ${ONAK_CONFIG} with 'use_keyd=true'"
return 1
fi
# only for socket
checkpath -d -q -o ${ONAK_USER}:${ONAK_GROUP} /var/run/onak
}
stop() {
ebegin "Stopping ${name}"
/usr/bin/onak-keydctl quit
eend $? "Failed to stop ${name}"
}
status() {
default_status
if [ $? = 0 ]; then
ebegin "Showing ${name} status"
/usr/bin/onak-keydctl status
fi
}