mirror of
https://github.com/gentoo-mirror/guru.git
synced 2025-04-10 12:08:43 -04:00
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>
33 lines
956 B
Plaintext
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 $?
|
|
}
|
|
|