Skip to content

sminos: Linux is a first-class sminos machine — daemon install writes a systemd user unit; a Resume's own job is never refused on Linux (Arkho #85, 7.159.0) - #203

Merged
SSFSKIM merged 4 commits into
mainfrom
arkho-85-linux-daemon
Oct 16, 2026

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 16, 2026

Copy link
Copy Markdown
Owner

Arkho board ticket #85: a Linux machine is a first-class sminos machine. sminos daemon install writes a systemd user unit there, and the process-start check that refused a Resume's own --bg job on Linux now reads the start precisely. Version 7.159.0, over main's 7.158.3 (main at 5704255c).

Problem

  • daemon install always wrote ~/Library/LaunchAgents/<label>.plist and printed launchctl lines, whatever the OS. On Linux nothing reads that file, so a cloud devbox (the personal cloud env's Ubuntu machine) could not run the daemon as a service.
  • The restart on new code relied on launchd's KeepAlive.
  • launched_by (a Resume's "started no earlier than the launch") fell back to ps -o lstart when the engine's record had no startedAt. Linux's procps adds a process's offset to /proc/stat's boot time, which is truncated to the second, so a process can read up to a second before it started. Reproduced live: on the proof VM (boot instant 0.68 s past btime's second), main's test_rpcs.py fails 4 Resume cases with "job … took the session, but no process of it holds the session after 30 s".

What this PR changes

  • Platform choice (sminos_daemon.service()): launchd on darwin, systemd on linux, a refusal elsewhere. SMINOS_SERVICE=launchd|systemd overrides it, for tests. The macOS path renders the same plist and prints the same lines.
  • The systemd unit (skills/sminos/references/sminos-daemon.service, rendered into ~/.config/systemd/user/sminos-daemon.service, $XDG_CONFIG_HOME when set), under the launchd agent's contract:
    • ExecStart runs installed_cli()'s stable path (the marketplace clone from an installed plugin, never the versioned cache).
    • It carries the same environment (launchd_env(), renamed service_env()): SMINOS_HOME, PATH, DAEMON_HOST, the gateway route.
    • The file is 0600 from its first byte (write_private, now shared with the plist).
    • Output goes to the registry's daemon.out (StandardOutput=append:).
    • Restart=always, RestartSec=10: the daemon's exit on new code restarts it.
    • KillMode=process: a stop or restart signals the daemon alone, as launchd kills only the job's process group. The daemon stops its uplink itself. What it started in a session of its own (derive --all, and a claude --bg from a spawn or Resume RPC together with the engine supervisor that may come up with it) runs on. Under the default control-group a plugin update would kill them.
    • WantedBy=default.target, so lingering starts it at boot.
    • Values are escaped for the unit grammar (unit_word: C escapes in a quoted word, %%). A registry path holding a line break is refused.
    • Install loads nothing. It prints the systemctl --user load and unload lines and loginctl enable-linger, which a user can run without sudo on Ubuntu 24.04.
  • Process start on Linux (sminos.proc_started_at): /proc/<pid>/stat's start ticks plus (now − /proc/uptime), within a clock tick of the true start. sminos_rpc.started_at takes the engine's record first, then this, then ps (on macOS ps floors the precise start, so it is never a second early). same_process and the derivation's pid check are unchanged: they compare two ps readings (the engine's procStart is itself LC_ALL=C TZ=UTC ps -o lstart), with a 2 s tolerance or as the same reading twice.
  • Docs: the sminos skill's daemon install line and paragraph, and CLAUDE.md's sminos row, describe both platforms.

The macOS-assumption sweep of skills/sminos/scripts/

Where Assumption Outcome
sminos_daemon.py install, own_code, cmd_run launchd only (plist path, launchctl, KeepAlive) fixed: systemd beside it
sminos_rpc.started_at ps -o lstart as exact to the second fixed: /proc first
sminos.read_proc_start / same_process / derive's pid check procps ps -o lstart holds on Linux (2 s tolerance, or the same reading compared). Reported: a minimal image without procps reads "", so the start check is skipped there and the pid alone decides. Ubuntu server images ship procps
sminos.boot_id, lib.sh _boot_id sysctl kern.boottime holds: /proc/sys/kernel/random/boot_id is read first
sminos launcher readlink -f holds: GNU coreutils, and macOS 12.3+
sminos_bridge.SOCKET_PATH_MAX = 103 macOS's sun_path holds: the smaller of the two limits (Linux allows 107)
sminos_control.supervisor_socket /tmp/cc-daemon-<uid>/<hash>/control.sock holds: the engine (2.1.300, rPe()) uses /tmp on every POSIX platform but Termux
sminos_tui.py tmux holds: portable
flock, AF_UNIX, os.kill(pid, 0) POSIX holds

Outside the sweep's scope, skills/issue-tracker/ still names launchd for the board runner. Not touched here.

Alternatives considered

  • Tolerate the truncated second in launched_by (started >= int(launched) - 1 when only ps can tell), relying on the job id. Rejected: it loosens the comparison on both platforms, while the precise reading fixes the measurement and leaves the comparison as it was.
  • KillMode=control-group (the default) or mixed: both kill the daemon's detached children at every plugin update. Phase 6 below shows the difference on this systemd.
  • RestartSec=60, launchd's ThrottleInterval: launchd restarts at once after a long run and throttles only a crash loop. systemd waits RestartSec after every exit. 10 s keeps a plugin update's gap short and a crash loop slow.

Validation Evidence

Claim Command Output
The Linux defect, reproduced main's tests/sminos/test_rpcs.py on the proof VM (Ubuntu 24.04 arm64, boot instant 0.68 s past btime) 4 of 48 fail, all Resume: "job … took the session, but no process of it holds the session after 30 s"
Fixed on the same boot, stand-in unchanged (no startedAt) the branch's full sminos suite on the VM, as a transient system unit test_rpcs.py 51 tests OK. All 1770 assertions at 11922775; all 1774 at the head 94916003
The truncated second, pinned python3 tests/sminos/test_rpcs.py LaunchStart 3 tests OK on macOS and Linux. With proc_started_at stubbed out (the old code) the own-job case fails
Unit rendering, platform choice, plist unchanged the install blocks of run-sminos-tests.sh the plist assertions are unchanged, pinned to launchd by SMINOS_SERVICE, and pass on both platforms. The systemd block checks the stable CLI, env and escaping, mode, Restart, KillMode, daemon.out, WantedBy, XDG_CONFIG_HOME, cache→clone, the line-break refusal and the linger line. Platform choice: the host's own (plist on Darwin, unit on Linux) and the three branches
macOS full sminos suite, slot-wrapped all 1774 at the head. The earlier run had 1769/1770: the one failure was "at most once more: two frames in all", TECH-DEBT T3's load-sensitive kill-before-settle assertion, which #198 makes event-driven
Shell lint scripts/lint-shell.sh tests/sminos/run-sminos-tests.sh clean
Independent review doperpowers:reviewer-high, two rounds Round 1, verdict incorrect, two P2s: a registry path with a line break could inject unit directives through StandardOutput=append:, and the printed loginctl enable-linger <user> took LOGNAME unquoted. Both fixed with tests (393f6fe6). Round 2: "No material findings", verdict correct

Live proof on a throwaway Ubuntu VM

Hetzner cax11 (ARM, the owner's devbox architecture), ubuntu-24.04, systemd 255, a login user dev. The plugin was laid out as the harness keeps it: a marketplace clone, the versioned cache, and known_marketplaces.json. The install ran from the cache's CLI. The VM and its SSH key were created for this run and deleted after it.

  1. Install and load. daemon install wrote the unit at 0600, its ExecStart the marketplace clone's CLI, and printed the commands. Running them gave active (running), and sminos daemon status reported daemon: running (pid …).
  2. Escaping, read by systemd itself. A unit rendered from a checkout at /tmp/esc/dp 50%$x with registry /tmp/esc/reg 100%$y and gateway values holding quotes, backslashes, % and $ was started with a stub program. The stub received its path, its arguments and every value exactly, and wrote to daemon.out at the escaped path. The first try found that ExecStart does not expand $$ in the program's path; fixed in 6ff6db4a.
  3. Hub. The desk's local hub (MAWS apps/desk-hub at master, local/run.ts) ran on the VM as a user service. hub enroll (code on stdin) enrolled the running daemon, its uplink connected, and project init --hub plus say put an event in the log. The hub showed arkho85-linux-daemon online: true and the event at offset 1, sealed.
  4. Logout. With lingering off, logout stopped dev's manager, and the daemon and hub with it. loginctl enable-linger as dev (no sudo) turned lingering on. After logout the daemon ran on under the same pid, and the hub saw it online.
  5. Code change. The marketplace clone fast-forwarded to a newer commit, as an update does. About 4 s later (after the tick in hand) the daemon logged "its code changed; exiting for a restart on the new code". systemd restarted it 10 s after that (NRestarts=1), the uplink reconnected, and a new event went up.
  6. KillMode. A detached child of a KillMode=process unit survived the unit's exit, restart and stop. Under the default control-group it was killed.
  7. Reboot. With nobody logged in after the reboot, lingering had started the daemon and the hub at boot. The uplink connected, a say reached the hub at offset 3, and the machine showed online.

The run predates 393f6fe6, so its install output still prints loginctl enable-linger dev. The head prints loginctl enable-linger, which the VM showed acts on the caller.

The run's transcript
== phase 1: install, load, status (2026-10-16T05:57:19Z)

$ uname -srm; . /etc/os-release; echo "$PRETTY_NAME"; systemctl --version | head -1; whoami; hostname
Linux 6.8.0-138-generic aarch64
Ubuntu 24.04.4 LTS
systemd 255 (255.4-1ubuntu8.17)
dev
arkho85-linux-daemon

$ loginctl show-user "$USER" -p Linger -p State
State=active
Linger=no

$ /home/dev/.claude/plugins/cache/doperpowers/doperpowers/7.159.0/skills/sminos/scripts/sminos daemon install
wrote /home/dev/.config/systemd/user/sminos-daemon.service
load it:   systemctl --user daemon-reload && systemctl --user enable --now sminos-daemon.service
unload it: systemctl --user disable --now sminos-daemon.service
to keep it running with nobody logged in (and from boot), lingering, once per user:
           loginctl enable-linger dev

$ ls -l ~/.config/systemd/user/sminos-daemon.service
-rw------- 1 dev dev 1878 Oct 16 05:57 /home/dev/.config/systemd/user/sminos-daemon.service

$ grep -v "^#" ~/.config/systemd/user/sminos-daemon.service | grep -v "^$"
[Unit]
Description=sminos daemon (doperpowers): mirror, delivery, and the uplink to a desk hub
[Service]
ExecStart="/home/dev/.claude/plugins/marketplaces/doperpowers/skills/sminos/scripts/sminos" daemon run
Restart=always
RestartSec=10
KillMode=process
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
Environment="SMINOS_HOME=/home/dev/.claude/sminos"
StandardOutput=append:/home/dev/.claude/sminos/daemon.out
StandardError=append:/home/dev/.claude/sminos/daemon.out
[Install]
WantedBy=default.target

$ systemctl --user daemon-reload && systemctl --user enable --now sminos-daemon.service
Created symlink /home/dev/.config/systemd/user/default.target.wants/sminos-daemon.service → /home/dev/.config/systemd/user/sminos-daemon.service.

$ systemctl --user show sminos-daemon -p ActiveState -p SubState -p MainPID -p NRestarts -p Restart -p KillMode -p ExecStart
Restart=always
MainPID=9368
NRestarts=0
ExecStart={ path=/home/dev/.claude/plugins/marketplaces/doperpowers/skills/sminos/scripts/sminos ; argv[]=/home/dev/.claude/plugins/marketplaces/doperpowers/skills/sminos/scripts/sminos daemon run ; ignore_errors=no ; start_time=[Fri 2026-10-16 05:57:20 UTC] ; stop_time=[n/a] ; pid=9368 ; code=(null) ; status=0/0 }
KillMode=process
ActiveState=active
SubState=running

$ /home/dev/.claude/plugins/cache/doperpowers/doperpowers/7.159.0/skills/sminos/scripts/sminos daemon status
daemon: running (pid 9368 since 2026-10-16T05:57:20Z)
derive: last started 3s ago, still running

$ cat ~/.claude/sminos/daemon.out; grep "daemon run" ~/.claude/sminos/daemon.log
sminos: migrated: linked /home/dev/.claude/orchestrating-daemons -> /home/dev/.claude/sminos; linked /home/dev/.claude/agora -> /home/dev/.claude/sminos
2026-10-16T05:57:20.608Z daemon run started (pid 9368, every 5s)

== phase 1b: what systemd hands the program of the rendered unit (2026-10-16T05:59:20Z)

$ HOME=/tmp/esc SMINOS_HOME="$ESC_REG" XDG_CONFIG_HOME=/tmp/esc/xdg ANTHROPIC_BASE_URL="$ESC_URL" ANTHROPIC_AUTH_TOKEN="$ESC_TOK" "$D/skills/sminos/scripts/sminos" daemon install
wrote /tmp/esc/xdg/systemd/user/sminos-daemon.service
load it:   systemctl --user daemon-reload && systemctl --user enable --now sminos-daemon.service
unload it: systemctl --user disable --now sminos-daemon.service
to keep it running with nobody logged in (and from boot), lingering, once per user:
           loginctl enable-linger dev

$ grep -E "^(ExecStart|Environment|StandardOutput)" /tmp/esc/xdg/systemd/user/sminos-daemon.service
ExecStart="/tmp/esc/dp 50%%$x/skills/sminos/scripts/sminos" daemon run
Environment="ANTHROPIC_AUTH_TOKEN=to%%k\"e\\n$n"
Environment="ANTHROPIC_BASE_URL=http://gw.test/p%%41th?a=\"b\"&c=\\d$HOME"
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"
Environment="SMINOS_HOME=/tmp/esc/reg 100%%$y"
StandardOutput=append:/tmp/esc/reg 100%%$y/daemon.out

$ systemctl --user start sminos-escape-check && sleep 2 && systemctl --user show sminos-escape-check -p ActiveState -p MainPID
MainPID=13797
ActiveState=active

$ cat "$ESC_REG/daemon.out"
path=/tmp/esc/dp 50%$x/skills/sminos/scripts/sminos
args=daemon run
env SMINOS_HOME=/tmp/esc/reg 100%$y
env ANTHROPIC_BASE_URL=http://gw.test/p%41th?a="b"&c=\d$HOME
env ANTHROPIC_AUTH_TOKEN=to%k"e\n$n

the program got its path, its arguments and every value exactly, in daemon.out at the escaped path: True

$ systemctl --user show sminos-escape-check -p LoadState
LoadState=not-found

== phase 2: local hub, enrollment, a hub project's log uplinked (2026-10-16T06:00:01Z)

$ systemctl --user daemon-reload && systemctl --user enable --now desk-hub.service
Created symlink /home/dev/.config/systemd/user/default.target.wants/desk-hub.service → /home/dev/.config/systemd/user/desk-hub.service.

$ curl -s $HUB/api/me; echo
{"org":{"id":"local","name":"Local org","created":"2026-10-16T06:00:05.956Z","key_check":null},"member":{"id":"23f5e025d23643aac12c2b9c1e69c791","email":"[email protected]","role":"admin","created":"2026-10-16T06:00:05.956Z"}}

$ printf "%s\n" "$CODE" | sminos hub enroll   # the code minted by the local hub stand-in, on stdin
enrolled this machine as arkho85-linux-daemon at http://127.0.0.1:8747 (org local); its credential is /home/dev/.claude/sminos/daemon/hub.json (mode 600)
The daemon's uplink connects with it within a minute (sminos daemon status); a project syncs through the hub once its .smns names it: sminos project init --hub, in its repository.

$ $S hub show
machine  arkho85-linux-daemon
hub      http://127.0.0.1:8747 (org local)
former   -
since    2026-10-16T06:00:06Z

$ mkdir -p ~/proj && cd ~/proj && git init -q && $S project init --name linux-proof --hub && git add .smns && git commit -qm "the project" && cat .smns
project linux-proof (81ee97e1-de5c-4d3e-be32-25e9c2715e2c) at /home/dev/proj/.smns, a hub project of http://127.0.0.1:8747 (org local) — commit it, so every clone is the same project
{
  "project": "81ee97e1-de5c-4d3e-be32-25e9c2715e2c",
  "name": "linux-proof",
  "remote": "",
  "hub": {
    "url": "http://127.0.0.1:8747",
    "org": "local"
  }
}

$ $S daemon status
daemon: running (pid 15292 since 2026-10-16T05:59:51Z)
uplink: running (pid 16179 since 2026-10-16T06:00:07Z)
linux-proof: never ticked
derive: last started 2m ago

$ cd ~/proj && $S say "hello from the Linux machine, through its systemd daemon"
recorded arkho85-linux-daemon/human:1 in linux-proof

$ curl -s $HUB/api/machines; echo
{"machines":[{"name":"arkho85-linux-daemon","client_id":"7ffa53ccae3b5b30b36d54ccc7864998.access","token_name":"desk-local-arkho85-linux-daemon","state":"active","enrollment":"acd9095c5d32db89b0b336301885d853","created":"2026-10-16T06:00:06.415Z","confirmed":"2026-10-16T06:00:07.211Z"}]}

$ curl -s $HUB/api/projects; echo
{"projects":[{"id":"81ee97e1-de5c-4d3e-be32-25e9c2715e2c","name":"linux-proof","registered_by":"arkho85-linux-daemon","created":"2026-10-16T06:00:07.386Z","archive_machine":null}]}

$ node ~/obs.mjs $HUB "$(python3 -c "import json,os; print(json.load(open(os.path.expanduser(\"~/proj/.smns\")))[\"project\"])")"
machines: [{"machine":"arkho85-linux-daemon","online":true,"policy":{"read_only":false,"ceiling":"default"},"checkouts":[{"path":"/home/dev/proj","branch":"main"}]}]
log: {"offset":1,"writer":"arkho85-linux-daemon/human","kind":"human","text":"hello from the Linux machine, through its systemd daemon","mac":"sealed"}
caught-up at {"t":"caught-up","offset":1}
frames seen: welcome, machines, pending, deliveries, log, caught-up

$ grep -E "uplink|enrolled" ~/.claude/sminos/daemon.log | tail -8
2026-10-16T06:00:06.442Z hub: enrolled as arkho85-linux-daemon at http://127.0.0.1:8747 (org local)
2026-10-16T06:00:07.166Z uplink: started (pid 16179) for http://127.0.0.1:8747 as arkho85-linux-daemon
2026-10-16T06:00:07.287Z uplink: connected to http://127.0.0.1:8747 as arkho85-linux-daemon (stream 1)
2026-10-16T06:00:07.466Z uplink: the hub says this machine does not write the archive of linux-proof

== phase 3a: lingering off, dev logged out (2026-10-16T06:00:42Z)

$ loginctl list-sessions --no-legend
38 0 root - - active no -

$ loginctl show-user dev -p Linger -p State 2>&1
Failed to get user: User ID 1000 is not logged in or lingering

$ ps -u dev -o pid,lstart,args --no-headers || echo "(no process of dev runs)"
(no process of dev runs)

$ journalctl _UID=$(id -u dev) --no-pager -o short-iso | grep -E "sminos-daemon.service|desk-hub.service" | tail -4
2026-10-16T06:00:35+00:00 arkho85-linux-daemon systemd[15275]: Stopping sminos-daemon.service - sminos daemon (doperpowers): mirror, delivery, and the uplink to a desk hub...
2026-10-16T06:00:35+00:00 arkho85-linux-daemon systemd[15275]: Stopped desk-hub.service - the desk's local hub (MAWS apps/desk-hub, local/run.ts), for the Arkho #85 proof.
2026-10-16T06:00:35+00:00 arkho85-linux-daemon systemd[15275]: desk-hub.service: Consumed 5.493s CPU time.
2026-10-16T06:00:35+00:00 arkho85-linux-daemon systemd[15275]: Stopped sminos-daemon.service - sminos daemon (doperpowers): mirror, delivery, and the uplink to a desk hub.

$ curl -s -m 3 http://127.0.0.1:8747/api/me || echo "(the hub, a user service of dev, is down too)"
(the hub, a user service of dev, is down too)

== phase 3b: dev logs in and turns lingering on (2026-10-16T06:01:13Z)

$ $S daemon status
daemon: running (pid 20071 since 2026-10-16T06:01:08Z)
uplink: running (pid 20129 since 2026-10-16T06:01:08Z)
linux-proof: last tick 4s ago — reconciled 0 · published 0 · delivered 0
derive: last started 3m ago

$ loginctl enable-linger dev && loginctl show-user dev -p Linger
Linger=yes

$ $S daemon status | head -2
daemon: running (pid 20071 since 2026-10-16T06:01:08Z)
uplink: running (pid 20129 since 2026-10-16T06:01:08Z)
(logging out)

== phase 3c: lingering on, dev logged out (2026-10-16T06:01:33Z)

$ loginctl list-sessions --no-legend
44 0 root - - active no -

$ loginctl show-user dev -p Linger -p State -p Sessions
State=lingering
Sessions=
Linger=yes

$ ps -u dev -o pid,lstart,args --no-headers | grep -E "sminos|run.ts" | grep -v grep
  20064 Fri Oct 16 06:01:07 2026 /usr/bin/node --experimental-strip-types --disable-warning=ExperimentalWarning local/run.ts --port 8747
  20071 Fri Oct 16 06:01:07 2026 python3 /home/dev/.claude/plugins/marketplaces/doperpowers/skills/sminos/scripts/sminos.py daemon run
  20129 Fri Oct 16 06:01:08 2026 /usr/bin/python3 /home/dev/.claude/plugins/marketplaces/doperpowers/skills/sminos/scripts/sminos.py daemon uplink

$ sudo -u dev XDG_RUNTIME_DIR=/run/user/$(id -u dev) systemctl --user show sminos-daemon -p ActiveState -p MainPID -p NRestarts
MainPID=20071
NRestarts=0
ActiveState=active

$ sudo -u dev -H /home/dev/.claude/plugins/marketplaces/doperpowers/skills/sminos/scripts/sminos daemon status
daemon: running (pid 20071 since 2026-10-16T06:01:08Z)
uplink: running (pid 20129 since 2026-10-16T06:01:08Z)
linux-proof: last tick 5s ago — reconciled 0 · published 0 · delivered 0
derive: last started 4m ago

$ sudo -u dev -H node /home/dev/obs.mjs http://127.0.0.1:8747 81ee97e1-de5c-4d3e-be32-25e9c2715e2c | grep -E "machines|frames"
machines: [{"machine":"arkho85-linux-daemon","online":true,"policy":{"read_only":false,"ceiling":"default"},"checkouts":[{"path":"/home/dev/proj","branch":"main"}]}]
frames seen: welcome, machines, pending, deliveries, log, caught-up

== phase 5: the CLI the unit runs changes (2026-10-16T06:02:35Z)

$ systemctl --user show sminos-daemon -p MainPID -p NRestarts -p ExecMainStartTimestamp
MainPID=20071
NRestarts=0
ExecMainStartTimestamp=Fri 2026-10-16 06:01:08 UTC

$ git -C $MKT log --oneline -1
11922775 sminos: Linux is a first-class sminos machine — daemon install writes a systemd user unit (Restart=always, KillMode=process, 0600, the stable CLI, the service env, daemon.out, lingering said), and launched_by reads a process's start off /proc to the tick, never the second before it (Arkho #85, 7.159.0)

$ git -C $MKT pull -q --ff-only /tmp/dp2.bundle arkho-85-linux-daemon && git -C $MKT log --oneline -1 && date -u +%FT%T.%3NZ
6ff6db4a sminos daemon install (systemd): a $ in the CLI's path stays as it is — ExecStart expands no variable in the program's path, as the live VM run showed
2026-10-16T06:02:35.681Z

$ systemctl --user show sminos-daemon -p MainPID -p NRestarts -p ExecMainStartTimestamp -p ActiveState
MainPID=24618
NRestarts=1
ExecMainStartTimestamp=Fri 2026-10-16 06:02:49 UTC
ActiveState=active

$ grep -E "daemon run|code changed|uplink: (started|connected)" ~/.claude/sminos/daemon.log | tail -6
2026-10-16T06:01:08.862Z uplink: started (pid 20129) for http://127.0.0.1:8747 as arkho85-linux-daemon
2026-10-16T06:01:10.937Z uplink: connected to http://127.0.0.1:8747 as arkho85-linux-daemon (stream 2)
2026-10-16T06:02:39.305Z daemon run (pid 20071): its code changed; exiting for a restart on the new code
2026-10-16T06:02:49.907Z daemon run started (pid 24618, every 5s)
2026-10-16T06:02:50.084Z uplink: started (pid 24628) for http://127.0.0.1:8747 as arkho85-linux-daemon
2026-10-16T06:02:50.129Z uplink: connected to http://127.0.0.1:8747 as arkho85-linux-daemon (stream 3)

$ tail -2 ~/.claude/sminos/daemon.out
sminos: migrated: linked /home/dev/.claude/orchestrating-daemons -> /home/dev/.claude/sminos; linked /home/dev/.claude/agora -> /home/dev/.claude/sminos
2026-10-16T06:02:39Z its code changed: exiting, to be restarted on the new code

$ journalctl --user -u sminos-daemon --no-pager -o short-iso | tail -3
2026-10-16T06:02:39+00:00 arkho85-linux-daemon systemd[20046]: sminos-daemon.service: Consumed 1.185s CPU time, 52.0M memory peak, 0B memory swap peak.
2026-10-16T06:02:49+00:00 arkho85-linux-daemon systemd[20046]: sminos-daemon.service: Scheduled restart job, restart counter is at 1.
2026-10-16T06:02:49+00:00 arkho85-linux-daemon systemd[20046]: Started sminos-daemon.service - sminos daemon (doperpowers): mirror, delivery, and the uplink to a desk hub.

$ $S daemon status
daemon: running (pid 24618 since 2026-10-16T06:02:49Z)
uplink: running (pid 24628 since 2026-10-16T06:02:50Z)
linux-proof: last tick 1s ago — reconciled 0 · published 0 · delivered 0
derive: last started 5m ago

$ cd ~/proj && $S say "after the update, from the restarted daemon"
recorded arkho85-linux-daemon/human:2 in linux-proof

$ node ~/obs.mjs http://127.0.0.1:8747 81ee97e1-de5c-4d3e-be32-25e9c2715e2c
machines: [{"machine":"arkho85-linux-daemon","online":true,"policy":{"read_only":false,"ceiling":"default"},"checkouts":[{"path":"/home/dev/proj","branch":"main"}]}]
log: {"offset":1,"writer":"arkho85-linux-daemon/human","kind":"human","text":"hello from the Linux machine, through its systemd daemon","mac":"sealed"}
log: {"offset":2,"writer":"arkho85-linux-daemon/human","kind":"human","text":"after the update, from the restarted daemon","mac":"sealed"}
caught-up at {"t":"caught-up","offset":2}
frames seen: welcome, machines, pending, deliveries, log, caught-up

== phase 6: KillMode=process against the default (2026-10-16T06:03:19Z)

KillMode=process: the first run started a detached child (pid 25788); after the run exited, was restarted, and the unit was stopped: it still runs

KillMode=control-group: the first run started a detached child (pid 26002); after the run exited, was restarted, and the unit was stopped: it was killed

rebooting at 2026-10-16T06:07:21Z; daemon pid before: 24618
scheduled
== phase 7: after the reboot (2026-10-16T06:08:09Z)

$ uptime -s; who -b
2026-10-16 06:07:41
         system boot  2026-10-16 06:07

$ loginctl list-sessions --no-legend
5 0 root - - active no -

$ loginctl show-user dev -p Linger -p State -p Sessions
State=lingering
Sessions=
Linger=yes

$ ps -u dev -o pid,lstart,args --no-headers | grep -E "sminos|run.ts" | grep -v grep
    864 Fri Oct 16 06:07:49 2026 /usr/bin/node --experimental-strip-types --disable-warning=ExperimentalWarning local/run.ts --port 8747
    866 Fri Oct 16 06:07:49 2026 python3 /home/dev/.claude/plugins/marketplaces/doperpowers/skills/sminos/scripts/sminos.py daemon run
    891 Fri Oct 16 06:07:49 2026 /usr/bin/python3 /home/dev/.claude/plugins/marketplaces/doperpowers/skills/sminos/scripts/sminos.py daemon uplink

$ sudo -u dev XDG_RUNTIME_DIR=/run/user/$(id -u dev) systemctl --user show sminos-daemon -p ActiveState -p MainPID -p ExecMainStartTimestamp
MainPID=866
ExecMainStartTimestamp=Fri 2026-10-16 06:07:50 UTC
ActiveState=active

$ sudo -u dev -H $S daemon status
daemon: running (pid 866 since 2026-10-16T06:07:50Z)
uplink: running (pid 891 since 2026-10-16T06:07:50Z)
linux-proof: last tick 4s ago — reconciled 0 · published 0 · delivered 0
derive: last started 10m ago

$ grep -E "daemon run started|uplink: (started|connected)" /home/dev/.claude/sminos/daemon.log | tail -3
2026-10-16T06:07:50.412Z daemon run started (pid 866, every 5s)
2026-10-16T06:07:50.718Z uplink: started (pid 891) for http://127.0.0.1:8747 as arkho85-linux-daemon
2026-10-16T06:07:53.364Z uplink: connected to http://127.0.0.1:8747 as arkho85-linux-daemon (stream 4)

$ cd /home/dev/proj && sudo -u dev -H $S say "after the reboot, nobody logged in"
recorded arkho85-linux-daemon/human:3 in linux-proof

$ sudo -u dev -H node /home/dev/obs.mjs http://127.0.0.1:8747 81ee97e1-de5c-4d3e-be32-25e9c2715e2c
machines: [{"machine":"arkho85-linux-daemon","online":true,"policy":{"read_only":false,"ceiling":"default"},"checkouts":[{"path":"/home/dev/proj","branch":"main"}]}]
log: {"offset":1,"writer":"arkho85-linux-daemon/human","kind":"human","text":"hello from the Linux machine, through its systemd daemon","mac":"sealed"}
log: {"offset":2,"writer":"arkho85-linux-daemon/human","kind":"human","text":"after the update, from the restarted daemon","mac":"sealed"}
log: {"offset":3,"writer":"arkho85-linux-daemon/human","kind":"human","text":"after the reboot, nobody logged in","mac":"sealed"}
caught-up at {"t":"caught-up","offset":3}
frames seen: welcome, machines, pending, deliveries, log, caught-up


$ loginctl disable-linger && loginctl show-user "$USER" -p Linger
Linger=no

$ loginctl enable-linger && loginctl show-user "$USER" -p Linger
Linger=yes

Residue

… a systemd user unit (Restart=always, KillMode=process, 0600, the stable CLI, the service env, daemon.out, lingering said), and launched_by reads a process's start off /proc to the tick, never the second before it (Arkho #85, 7.159.0)
… — ExecStart expands no variable in the program's path, as the live VM run showed
…e break, and print loginctl enable-linger with no user taken from LOGNAME (Arkho #85 review)
@SSFSKIM
SSFSKIM merged commit 84814a0 into main Oct 16, 2026
SSFSKIM added a commit that referenced this pull request Oct 16, 2026
#203 fixes the Linux start-time refusal at its source (sminos_rpc reads
/proc). The stand-in's startedAt and the TECH-DEBT note about it go, so
test_rpcs.py exercises that path. Version files take main's side; the bump
follows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant