guru/app-misc/ollama/files/ollama.init
Paul Zander 0e23d43658
app-misc/ollama: update to 0.5.7-r1
Bug: https://bugs.gentoo.org/948424
Bug: https://bugs.gentoo.org/935842
Closes: https://bugs.gentoo.org/920301
Signed-off-by: Paul Zander <negril.nx+gentoo@gmail.com>
2025-02-08 22:42:29 +01:00

33 lines
956 B
Plaintext

#!/sbin/openrc-run
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License, v2
description="Ollama Service"
command="/usr/bin/ollama"
command_args="serve"
command_user="ollama"
command_group="ollama"
command_background="yes"
pidfile="/run/ollama.pid"
log="/var/log/ollama/ollama.log"
# Ollama allows cross-origin requests from 127.0.0.1 and 0.0.0.0 by default.
# Additional origins can be configured with OLLAMA_ORIGINS.
# export OLLAMA_ORIGINS="<ip>"
start() {
ebegin "Starting $description"
exec >> >(logger -t "$RC_SVCNAME Start daemon" -p daemon.info)
start-stop-daemon --start --background --user "$command_user" --group "$command_group" \
--pidfile "$pidfile" --make-pidfile --exec $command $command_args -1 $log -2 $log
eend $?
}
stop() {
ebegin "Stopping $description"
exec >> >(logger -t "$RC_SVCNAME Stop daemon" -p daemon.info)
start-stop-daemon --stop --pidfile "$pidfile"
eend $?
}