code wiki / (root) / nx_torrent_up.nx

nx_torrent_up.nx

buildroot/runtime/nx_torrent_up.nx

9669 B156 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic torrent
docsdependenciesstructsconstsfunctions

about

nx_torrent_up.nx -- SOVEREIGN bring-up + lifecycle for the /torrent UI stack (X-TORRENT-UI-002). REPLACES the (forbidden) bash bring-up entirely. Pure NishiLang orchestration -- sys_fork / execve / wait4 / kill + openat/read/write. NO bash, NO sh, NO pkill/curl/nohup/timeout. It builds the three organs through the WOMB in --build-only mode (so a worker's live-download side effect never fires), then launches the daemon detached and records its pid so it can be stopped sovereignly. nx_torrent_up -> build-if-missing (worker, discover, daemon) then launch daemon (idempotent) nx_torrent_up down -> kill the daemon by pidfile + signal any worker to self-stop nx_torrent_up status -> report whether the daemon process is alive Run it the sovereign way: ./_offc/nx_sov_build_run.elf nx_torrent_up (WOMB builds + runs this = bring-up) license_tier: ORIGINAL layer: L7 (supervises the L6 daemon over the L4/L5 organs) module: nishi-core.torrent.up depends: nishi-core.syscalls

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_torrent_up.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap tu_streq tu_read_pid sys_openat_rd sys_mmap ↻ sys_read sys_close nx_kill sys_openat_wr sys_write sys_close ↻ tu_puts sys_write ↻ tu_putn sys_mmap ↻ sys_write ↻ sys_exit sys_sleep_ms sys_mmap ↻ sys_munmap sys_fork nx_setsid sys_dup3 sys_execve tu_write_pid sys_openat_wr ↻ sys_mmap ↻ sys_write ↻ sys_close ↻

structs

none

consts

none

functions

17func tu_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
18func tu_putn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
27func tu_streq(a: *u8, b: *u8) -> i64
called by 1: main
33func tu_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 }
35func tu_mtime(path: *u8) -> i64
called by 1: tu_need_build calls 2: sys_mmapsys_fstatat
43func tu_need_build(src: *u8, elf: *u8) -> i64
51func tu_write_pid(path: *u8, pid: i64) -> i64
62func tu_read_pid(path: *u8) -> i64
72func tu_build(womb: *u8, name: *u8, envp: *i64) -> i64
83func main(argc: i64, argv: *i64) -> i64