etc: junction, splinter and the four daemons as native services

Six rc.d scripts, all off by default (junction=YES etc. in /etc/rc.conf):
junction (the policy router, 127.0.0.1:8090), splinter (its MCP registry,
8098), wikid (8796), skilld (8790), tasksd (8781) and memoryd (8795).
The programs run in the foreground, so command_args ends in "&"; stop finds
them by their command, they write no pid file.

/etc/junction/junction.conf is a loopback listener with no endpoints and no
rules: a request is answered 503 naming why until one is added (the commented
block is the smallest working setup).  /etc/splinter/splinter.conf has one
provider, the local junction, so the routing decision stays in
/etc/junction/junction.conf and not in splinter.

wikid and memoryd take their embeddings from the local junction and keep
their data in /var/db/<name>; each start_precmd makes the directory.  skilld
and tasksd use their own stores, /var/db/skilld and /var/db/tasksd.

The scripts are installed by src/etc/rc.d/Makefile, the configurations by the
subdir loop in src/etc/Makefile, the directories by NetBSD.dist.base, and the
set list (src/distrib/sets/lists/etc/mi) carries all eight files.

Measured: sh -n on all six rc=0; /sbin/rcorder rc.d/* rc=0, junction at 113
before splinter (117), no stderr.
This commit is contained in:
lotherk committed 2026-11-22 11:40:50 +01:00
1 parent 71ccd4b0b9
commit 62d9bb9c71
14 files changed
+288 -6

No files matched your search

+8
View File
@@ -92,6 +92,7 @@
./etc/iscsi/auths etc-iscsi-etc iscsi
./etc/iscsi/targets etc-iscsi-etc iscsi
./etc/iscsi/volumes etc-iscsi-etc
./etc/junction/junction.conf etc-sys-etc
./etc/kyua/kyua.conf etc-kyua-etc kyua
./etc/lkm.conf etc-obsolete obsolete
./etc/localtime etc-sys-etc
@@ -253,6 +254,7 @@
./etc/rc.d/iscsid_volumes etc-iscsi-rc
./etc/rc.d/isdnd etc-obsolete obsolete
./etc/rc.d/isibootd etc-bootserver-rc
./etc/rc.d/junction etc-sys-rc
./etc/rc.d/kdc etc-krb5-rc
./etc/rc.d/kerberos etc-obsolete obsolete
./etc/rc.d/ldconfig etc-sys-rc
@@ -267,6 +269,7 @@
./etc/rc.d/lvmlockdir etc-sys-rc
./etc/rc.d/makemandb etc-man-rc
./etc/rc.d/mdnsd etc-mdns-rc
./etc/rc.d/memoryd etc-sys-rc
./etc/rc.d/mixerctl etc-audio-rc
./etc/rc.d/modules etc-sys-rc
./etc/rc.d/mopd etc-bootserver-rc
@@ -320,7 +323,9 @@
./etc/rc.d/screenblank etc-sys-rc
./etc/rc.d/sdpd etc-obsolete obsolete
./etc/rc.d/securelevel etc-sys-rc
./etc/rc.d/skilld etc-sys-rc
./etc/rc.d/smtoff etc-sys-rc
./etc/rc.d/splinter etc-sys-rc
./etc/rc.d/sshd etc-secsh-rc
./etc/rc.d/staticroute etc-sys-rc
./etc/rc.d/swap1 etc-sys-rc
@@ -329,6 +334,7 @@
./etc/rc.d/sysdb etc-sys-rc
./etc/rc.d/syslogd etc-sys-rc
./etc/rc.d/systemfs etc-obsolete obsolete
./etc/rc.d/tasksd etc-sys-rc
./etc/rc.d/timed etc-timed-rc
./etc/rc.d/tpctl etc-sys-rc
./etc/rc.d/ttys etc-sys-rc
@@ -336,6 +342,7 @@
./etc/rc.d/veriexec etc-sys-rc
./etc/rc.d/virecover etc-sys-rc
./etc/rc.d/wdogctl etc-sysutil-rc
./etc/rc.d/wikid etc-sys-rc
./etc/rc.d/wpa_supplicant etc-net-rc
./etc/rc.d/wscons etc-sys-rc
./etc/rc.d/wsmoused etc-sys-rc
@@ -369,6 +376,7 @@
./etc/signify/makronix-0.99.pub etc-sys-etc
./etc/signify/makronix-0.99.pub.sig etc-sys-etc
./etc/signify/makronix-root.pub etc-sys-etc
./etc/splinter/splinter.conf etc-sys-etc
./etc/skel/.cshrc etc-sys-etc
./etc/skel/.login etc-sys-etc
./etc/skel/.logout etc-sys-etc
+1 -1
View File
@@ -356,7 +356,7 @@ install-etc-files: .PHONY .MAKE check_DESTDIR MAKEDEV
/dev/null ${DESTDIR}${file}; \
else true; fi
.endfor
.for subdir in . defaults autofs bluetooth iscsi mtree namedb pam.d powerd rc.d root signify skel ssh unbound
.for subdir in . defaults autofs bluetooth iscsi junction mtree namedb pam.d powerd rc.d root signify skel ssh splinter unbound
${MAKEDIRTARGET} ${subdir} configinstall
.endfor
${MAKEDIRTARGET} ${NETBSDSRCDIR}/external/bsd/dhcpcd/sbin/dhcpcd configinstall
+14
View File
@@ -0,0 +1,14 @@
# License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree.
#
# The default junction configuration: a loopback listener, no endpoints and no
# rules. A request that no rule matches is answered 503, naming why; the
# commented example below is the smallest working setup.
#
.include <bsd.own.mk>
CONFIGFILES= junction.conf
FILESDIR= /etc/junction
FILESMODE= 644
.include <bsd.prog.mk>
+28
View File
@@ -0,0 +1,28 @@
# License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree.
# junction.conf -- the policy router for OpenAI-compatible endpoints.
#
# pf.conf-style grammar: one keyword per line, braces group. This default
# listens on the loopback only and routes nothing; add an endpoint and a rule
# (a worked example is /usr/pkg/share/junction/examples/olivia.conf) and
# start the service with junction=YES in /etc/rc.conf.
listen 127.0.0.1:8090
connect_timeout_ms 1500
offline_hold_s 20
max_body_bytes 67108864
max_inflight 4
queue_timeout 300
# A local model server and the rule that sends every request to it:
#
# endpoint local {
# base http://127.0.0.1:11434/v1
# kind local
# context 32768
# timeout 900
# idle_timeout 45
# cooldown 60
# }
#
# req * pass local
+2
View File
@@ -39,6 +39,7 @@
./etc/fonts/conf.avail
./etc/fonts/conf.d
./etc/iscsi
./etc/junction
./etc/kerberosV
./etc/kyua
./etc/mail
@@ -55,6 +56,7 @@
./etc/openssl/private mode=0700
./etc/pam.d
./etc/signify
./etc/splinter
./etc/postfix
./etc/powerd
./etc/powerd/scripts
+5 -5
View File
@@ -25,10 +25,10 @@ CONFIGFILES=\
gpio \
hostapd httpd \
identd ifwatchd inetd ip6addrctl ipfilter ipfs ipmon ipnat \
ipsec irdaattach iscsi_target iscsid iscsid_volumes isibootd \
ipsec irdaattach iscsi_target iscsid iscsid_volumes isibootd junction \
kdc \
ldconfig ldpd lvmlockdir local lpd lvm \
makemandb mdnsd mixerctl modules mopd motd mountall \
makemandb mdnsd memoryd mixerctl modules mopd motd mountall \
mountcritlocal mountcritremote mountd moused mrouted \
named ndbootd network newsyslog nfsd nfslocking npf npf_boot \
npfd ntpd ntpdate \
@@ -37,10 +37,10 @@ CONFIGFILES=\
racoon rpcbind raidframe raidframeparity random_seed rarpd \
rbootd rcorder_cache resize_root rndctl root route6d routed \
rtadvd rtclocaltime rwho \
savecore screenblank securelevel smtoff sshd \
staticroute swap1 swap2 sysctl sysdb syslogd \
savecore screenblank securelevel skilld smtoff splinter sshd \
staticroute swap1 swap2 sysctl sysdb syslogd tasksd \
timed tpctl ttys \
veriexec virecover wdogctl wpa_supplicant wscons wsmoused
veriexec virecover wdogctl wikid wpa_supplicant wscons wsmoused
FILESDIR= /etc/rc.d
FILESMODE= ${BINMODE}
+29
View File
@@ -0,0 +1,29 @@
#!/bin/sh
#
# $NetBSD$
# License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree.
#
# junction -- policy router for OpenAI-compatible model endpoints.
#
# Off until junction=YES in /etc/rc.conf. Endpoints and rules live in
# /etc/junction/junction.conf.
# PROVIDE: junction
# REQUIRE: NETWORKING
# KEYWORD: shutdown
$_rc_subr_loaded . /etc/rc.subr
name="junction"
rcvar=$name
command="/usr/pkg/bin/junction"
command_args="--config /etc/junction/junction.conf &"
required_files="/etc/junction/junction.conf"
load_rc_config $name
: ${junction:=NO}
: ${junction_flags:=""}
# The program runs in the foreground; the "&" in command_args puts it in the
# background, and stop finds it by its command (it writes no pid file).
run_rc_command "$1"
+35
View File
@@ -0,0 +1,35 @@
#!/bin/sh
#
# $NetBSD$
# License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree.
#
# memoryd -- long-term memory, served over MCP.
#
# Off until memoryd=YES in /etc/rc.conf. The memories live in /var/db/memoryd
# and the embeddings come from the local junction (127.0.0.1:8090).
# PROVIDE: memoryd
# REQUIRE: junction
# KEYWORD: shutdown
$_rc_subr_loaded . /etc/rc.subr
name="memoryd"
rcvar=$name
command="/usr/pkg/bin/memoryd"
memoryd_env="MEMORYD_HOME=/var/db/memoryd EMBED_URL=http://127.0.0.1:8090/v1/embeddings EMBED_MODEL=nomic-embed-text"
command_args="--http 127.0.0.1:8795 &"
start_precmd="memoryd_precmd"
memoryd_precmd()
{
mkdir -p /var/db/memoryd
}
load_rc_config $name
: ${memoryd:=NO}
: ${memoryd_flags:=""}
# The program runs in the foreground; the "&" in command_args puts it in the
# background, and stop finds it by its command (it writes no pid file).
run_rc_command "$1"
+34
View File
@@ -0,0 +1,34 @@
#!/bin/sh
#
# $NetBSD$
# License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree.
#
# skilld -- the shared skill library, served over MCP.
#
# Off until skilld=YES in /etc/rc.conf. The library lives in /var/db/skilld.
# PROVIDE: skilld
# REQUIRE: NETWORKING
# KEYWORD: shutdown
$_rc_subr_loaded . /etc/rc.subr
name="skilld"
rcvar=$name
command="/usr/pkg/bin/skilld"
skilld_env="SKILLD_HOME=/var/db/skilld"
command_args="--http 127.0.0.1:8790 &"
start_precmd="skilld_precmd"
skilld_precmd()
{
mkdir -p /var/db/skilld
}
load_rc_config $name
: ${skilld:=NO}
: ${skilld_flags:=""}
# The program runs in the foreground; the "&" in command_args puts it in the
# background, and stop finds it by its command (it writes no pid file).
run_rc_command "$1"
+31
View File
@@ -0,0 +1,31 @@
#!/bin/sh
#
# $NetBSD$
# License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree.
#
# splinter -- the agent harness, here as its MCP registry server.
#
# Off until splinter=YES in /etc/rc.conf. The provider in
# /etc/splinter/splinter.conf is the local junction, so the routing decision
# stays in /etc/junction/junction.conf. The gateway mode (--daemon, Telegram)
# is a matter of splinter_flags in /etc/rc.conf, not the default.
# PROVIDE: splinter
# REQUIRE: junction
# KEYWORD: shutdown
$_rc_subr_loaded . /etc/rc.subr
name="splinter"
rcvar=$name
command="/usr/pkg/bin/splinter"
command_args="--config /etc/splinter/splinter.conf --mcp-server-listen 127.0.0.1 --mcp-listen-port 8098 &"
required_files="/etc/splinter/splinter.conf"
load_rc_config $name
: ${splinter:=NO}
: ${splinter_flags:=""}
# The program runs in the foreground; the "&" in command_args puts it in the
# background, and stop finds it by its command (it writes no pid file).
run_rc_command "$1"
+34
View File
@@ -0,0 +1,34 @@
#!/bin/sh
#
# $NetBSD$
# License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree.
#
# tasksd -- the task board, served over MCP.
#
# Off until tasksd=YES in /etc/rc.conf. The tasks live in /var/db/tasksd.
# PROVIDE: tasksd
# REQUIRE: NETWORKING
# KEYWORD: shutdown
$_rc_subr_loaded . /etc/rc.subr
name="tasksd"
rcvar=$name
command="/usr/pkg/bin/tasksd"
tasksd_env="TASKD_HOME=/var/db/tasksd"
command_args="--http 127.0.0.1:8781 &"
start_precmd="tasksd_precmd"
tasksd_precmd()
{
mkdir -p /var/db/tasksd
}
load_rc_config $name
: ${tasksd:=NO}
: ${tasksd_flags:=""}
# The program runs in the foreground; the "&" in command_args puts it in the
# background, and stop finds it by its command (it writes no pid file).
run_rc_command "$1"
+35
View File
@@ -0,0 +1,35 @@
#!/bin/sh
#
# $NetBSD$
# License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree.
#
# wikid -- named knowledge bases, served over MCP.
#
# Off until wikid=YES in /etc/rc.conf. The pages live in /var/db/wikid and
# the embeddings come from the local junction (127.0.0.1:8090).
# PROVIDE: wikid
# REQUIRE: junction
# KEYWORD: shutdown
$_rc_subr_loaded . /etc/rc.subr
name="wikid"
rcvar=$name
command="/usr/pkg/bin/wikid"
wikid_env="WIKID_HOME=/var/db/wikid EMBED_URL=http://127.0.0.1:8090/v1/embeddings EMBED_MODEL=nomic-embed-text"
command_args="--http 127.0.0.1:8796 &"
start_precmd="wikid_precmd"
wikid_precmd()
{
mkdir -p /var/db/wikid
}
load_rc_config $name
: ${wikid:=NO}
: ${wikid_flags:=""}
# The program runs in the foreground; the "&" in command_args puts it in the
# background, and stop finds it by its command (it writes no pid file).
run_rc_command "$1"
+14
View File
@@ -0,0 +1,14 @@
# License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree.
#
# The default splinter configuration: one provider, the local junction. The
# service passes --config /etc/splinter/splinter.conf, and every
# splinter.conf.d/*.conf beside it is read too.
#
.include <bsd.own.mk>
CONFIGFILES= splinter.conf
FILESDIR= /etc/splinter
FILESMODE= 644
.include <bsd.prog.mk>
+18
View File
@@ -0,0 +1,18 @@
# License: CNCL 1.0 (Could Not Care Less), see LICENSE at the top of the tree.
# splinter.conf -- the default of the Makronix install.
#
# splinter reads this one file (the service passes --config) plus every
# splinter.conf.d/*.conf beside it. The provider is the local junction, so
# where a request goes is decided in /etc/junction/junction.conf, not here.
# `splinter --init-config` writes the full commented example.
core {
default = local
}
provider local {
about = "the local junction (see /etc/junction/junction.conf)"
kind = openai
endpoint = http://127.0.0.1:8090/v1
model = default
}