abf1280f1ad9

fix service status pager hang (systemctl --no-pager) and add G-05/09/11 local test; v3.0.4

time
2026-05-29 22:31 UTC · 4 months ago
machine
koh2
parent
d4d5b99bbef8
3 files build.zig.zon+1 −1src/exec.zig+2 −1test/vm/tests/local.sh+38 −0
build.zig.zon+1 −1
@@ -9,7 +9,7 @@99     .name = .nina,1010     // This is a [Semantic Version](https://semver.org/).1111     // In a future version of Zig it will be used for package deduplication.12-    .version = "3.0.3",12+    .version = "3.0.4",1313     // Together with name, this represents a globally unique package1414     // identifier. This field is generated by the Zig toolchain when the1515     // package is first created, and then *never changes*. This allows

view file

src/exec.zig+2 −1
@@ -276,7 +276,8 @@276276 }277277 278278 pub fn serviceCtl(io: std.Io, machine: *const types.Machine, gpa: std.mem.Allocator, verb: []const u8, name: []const u8) !u8 {279-    return stream(io, machine, gpa, &.{ "sudo", "systemctl", verb, name });279+    // --no-pager: `systemctl status` pipes to a pager on a tty and would block.280+    return stream(io, machine, gpa, &.{ "sudo", "systemctl", "--no-pager", verb, name });280281 }281282 282283 pub fn serviceLogs(io: std.Io, machine: *const types.Machine, gpa: std.mem.Allocator, name: []const u8, last: u32, follow: bool) !u8 {

view file

test/vm/tests/local.sh+38 −0
@@ -0,0 +1,38 @@1+#!/usr/bin/env sh2+# G-05 (list) + G-09 (services) + G-11 (store/channel/profile/pkg/hash) — the3+# non-interactive local commands. install/remove/try are interactive (prompt or4+# spawn a shell) and are validated separately. `service logs` must use --last5+# (bare logs follows with journalctl -f and would hang).6+set -u7+N=/root/nina8+9+echo "KILN_LOCAL_BEGIN"10+11+echo "### G-05 T-077 nina list (expect baseline packages)"12+$N list </dev/null; echo "LIST_RC=$?"13+14+echo "### G-09 T-110 nina service list (expect sshd active)"15+$N service list </dev/null; echo "SVCLIST_RC=$?"16+echo "### G-09 T-111 nina service status sshd"17+$N service status sshd </dev/null; echo "SVCSTATUS_RC=$?"18+echo "### G-09 T-113 nina service restart sshd"19+$N service restart sshd </dev/null; echo "SVCRESTART_RC=$?"20+echo "### G-09 T-115 nina service logs sshd --last 10"21+$N service logs sshd --last 10 </dev/null; echo "SVCLOGS_RC=$?"22+23+echo "### G-11 T-140 nina store info"24+$N store info </dev/null; echo "STOREINFO_RC=$?"25+echo "### G-11 T-143 nina store path ripgrep"26+$N store path ripgrep </dev/null; echo "STOREPATH_RC=$?"27+echo "### G-11 T-144 nina channel list"28+$N channel list </dev/null; echo "CHANNEL_RC=$?"29+echo "### G-11 T-145 nina profile list"30+$N profile list </dev/null; echo "PROFILE_RC=$?"31+echo "### G-11 T-148 nina pkg size ripgrep"32+$N pkg size ripgrep </dev/null; echo "PKGSIZE_RC=$?"33+echo "### G-11 T-150 nina hash <file>"34+echo hello > /tmp/h; $N hash /tmp/h </dev/null; echo "HASH_RC=$?"35+echo "### G-11 T-142 nina store gc"36+$N store gc </dev/null; echo "STOREGC_RC=$?"37+38+echo "KILN_LOCAL_END"

view file