app-accessibility/whisper-cpp: Adding OpenRC init script for whisper-server

Signed-off-by: Kevin Martin <kevinmbecause@gmail.com>
This commit is contained in:
Kevin Martin
2026-03-15 17:42:15 -04:00
parent 80749f4aa9
commit 3c79f1dd7a
3 changed files with 37 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
# model file to use
whisper_model="/foo/bar/ggml-base.en.bin"
# log to syslog
# output_logger="logger -t \"$RC_SVCNAME\" -p daemon.info"
# error_logger="logger -t \"$RC_SVCNAME\" -p daemon.err"
# log to file
output_log="/var/log/$RC_SVCNAME/$RC_SVCNAME.log"
error_log="/var/log/$RC_SVCNAME/$RC_SVCNAME.log"
# user to run daemon as
command_user="whisper"
# extra options
command_args="-t 8 --port 8124"

View File

@@ -0,0 +1,14 @@
#!/sbin/openrc-run
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License, v2
supervisor=supervise-daemon
description="Whisper-CPP Service"
command="/usr/bin/whisper-server"
command_args+=" -m ${whisper_model}"
required_files="${whisper_model}"
start_pre() {
checkpath --directory --owner $command_user --mode 0775 \
/var/log/$RC_SVCNAME
}

View File

@@ -47,3 +47,10 @@ src_configure() {
)
cmake_src_configure
}
src_install() {
cmake_src_install
newinitd "${FILESDIR}/${PN}.init" "${PN}"
newconfd "${FILESDIR}/${PN}.confd" "${PN}"
}