[Unit] # Template for /etc/systemd/system/junction.service (or a copy under # ~/.config/systemd/user/). make install only lays down the binary, not the unit: # paths and environment files differ per host. Description=junction — model router (rules, failover, wake, passthrough) After=network-online.target Wants=network-online.target # A router in front of the local agents must not be the thing that dies quietly: with # Restart=always alone, systemd stops restarting after five starts in ten seconds (the # default), and a crash loop leaves the router dead. These two keys belong in [Unit] — # in [Service] systemd ignores them without a word. StartLimitIntervalSec=0 StartLimitBurst=0 [Service] Type=simple User=lotherk Group=lotherk Environment=HOME=/home/lotherk # The cloud key lives in Hermes' .env; junction only reads it from the environment # and never logs it. EnvironmentFile=/home/lotherk/.hermes/.env # Upstream keys for ollama, budgets, virtual keys (0600 root) EnvironmentFile=-/etc/junction/junction.env # The unix control socket lives in /run/junction — /run is tmpfs and empty after every # reboot. Without RuntimeDirectory the bind fails with "No such file or directory": # junction keeps running and only reports over TCP, while the dashboard (which uses the # socket) silently shows nothing. That is exactly what happened once — which is why the # line belongs here and not in somebody's memory. RuntimeDirectory=junction RuntimeDirectoryMode=0750 ExecStart=/usr/local/bin/junction --config /etc/junction/junction.conf Restart=always RestartSec=3 [Install] WantedBy=multi-user.target