Index | Thread | Search

From:
Kirill A. Korinsky <kirill@korins.ky>
Subject:
misc/llama.cpp: add rc script for llama-server
To:
OpenBSD ports <ports@openbsd.org>
Date:
Sat, 08 Nov 2025 00:33:11 +0100

Download raw body.

Thread
ports@,

I'd like to llama.cpp a rc script to run its llama-server.

I also would like to reuse user from kde3 which was removed about 5 years
ago.

Ok?

Index: misc/llama.cpp/Makefile
===================================================================
RCS file: /home/cvs/ports/misc/llama.cpp/Makefile,v
diff -u -p -r1.11 Makefile
--- misc/llama.cpp/Makefile	4 Nov 2025 15:05:41 -0000	1.11
+++ misc/llama.cpp/Makefile	7 Nov 2025 23:28:55 -0000
@@ -3,6 +3,7 @@ COMMENT =		LLM inference system
 GH_ACCOUNT =		ggml-org
 GH_PROJECT =		llama.cpp
 GH_TAGNAME =		b6934
+REVISION =		0
 PKGNAME =		llama.cpp-0.0.${GH_TAGNAME:S/b//}
 
 SHARED_LIBS +=		llama 3.0
Index: misc/llama.cpp/pkg/PLIST
===================================================================
RCS file: /home/cvs/ports/misc/llama.cpp/pkg/PLIST,v
diff -u -p -r1.5 PLIST
--- misc/llama.cpp/pkg/PLIST	1 Oct 2025 19:44:07 -0000	1.5
+++ misc/llama.cpp/pkg/PLIST	7 Nov 2025 22:46:45 -0000
@@ -1,3 +1,6 @@
+@newgroup _llama-server:583
+@newuser _llama-server:583:_llama-server::llama-server account:${LOCALSTATEDIR}/db/llama-server:/sbin/nologin
+@rcscript ${RCDIR}/llama_server
 bin/convert_hf_to_gguf.py
 @bin bin/llama-batched
 @bin bin/llama-batched-bench
@@ -43,3 +46,10 @@ lib/cmake/llama/llama-version.cmake
 @lib lib/libllama.so.${LIBllama_VERSION}
 @lib lib/libmtmd.so.${LIBmtmd_VERSION}
 lib/pkgconfig/llama.pc
+@owner _llama-server
+@group _llama-server
+@sample ${LOCALSTATEDIR}/db/llama-server/
+@owner
+@group
+share/examples/login.conf.d/llama_server
+@sample ${SYSCONFDIR}/login.conf.d/llama_server
Index: misc/llama.cpp/pkg/llama_server.login
===================================================================
RCS file: misc/llama.cpp/pkg/llama_server.login
diff -N misc/llama.cpp/pkg/llama_server.login
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ misc/llama.cpp/pkg/llama_server.login	7 Nov 2025 22:50:35 -0000
@@ -0,0 +1,5 @@
+llama_server:\
+	:datasize=16G:\
+	:coredumpsize=0:\
+	:setenv=LLAMA_CACHE=/var/db/llama-server:\
+	:tc=daemon:
Index: misc/llama.cpp/pkg/llama_server.rc
===================================================================
RCS file: misc/llama.cpp/pkg/llama_server.rc
diff -N misc/llama.cpp/pkg/llama_server.rc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ misc/llama.cpp/pkg/llama_server.rc	7 Nov 2025 23:19:11 -0000
@@ -0,0 +1,12 @@
+#!/bin/ksh
+
+daemon="${TRUEPREFIX}/bin/llama-server"
+daemon_user="_llama-server"
+daemon_logger="daemon.info"
+
+. /etc/rc.d/rc.subr
+
+rc_bg=YES
+rc_reload=NO
+
+rc_cmd $1
Index: infrastructure/db/user.list
===================================================================
RCS file: /home/cvs/ports/infrastructure/db/user.list,v
diff -u -p -r1.473 user.list
--- infrastructure/db/user.list	19 Oct 2025 16:23:20 -0000	1.473
+++ infrastructure/db/user.list	6 Nov 2025 23:24:08 -0000
@@ -91,7 +91,7 @@ id  user		group		port
 580 _puppet		_puppet		sysutils/ruby-{puppet,openvox}
 581 _piknik		_piknik		sysutils/piknik
 582 _tabled		_tabled		sysutils/tabled
-#583			_kdesud		x11/kde/base3
+583 _llama-server	_llama-server	misc/llama.cpp
 584 _wstunnel		_wstunnel	net/wstunnel
 585 _lighttpd		_lighttpd	www/lighttpd
 586 _gnugk		_gnugk		net/gnugk


-- 
wbr, Kirill