From 0769a0ea0a8654e5e50e03365545c8ccf58d6b91 Mon Sep 17 00:00:00 2001 From: Pjotr Date: Sun, 8 Nov 2026 15:52:36 +0000 Subject: docs: match the server by argv[0], not by a substring of its command line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The restart section added a moment ago pointed at the trap and then walked into its other half: `nohup env … ./target/release/genenetwork4 &` leaves an `env` wrapper whose command line also contains the binary path, so matching `*release/genenetwork4*` finds the wrapper -- the pid file named a process that exits while the server keeps running, and the next `kill $(cat /tmp/gn4.pid)` did nothing at all. Read `argv[0]` (the first NUL-terminated word) and compare it to the binary path instead; that finds the serving process and only it. Applied here, it is what finally moved production off the previous build. --- docs/www/operator-checklist.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/www/operator-checklist.md b/docs/www/operator-checklist.md index a5b56fb..47319eb 100644 --- a/docs/www/operator-checklist.md +++ b/docs/www/operator-checklist.md @@ -312,14 +312,18 @@ nothing had changed. Two checks make that impossible to miss: ```sh -# who is actually listening (no ps here; read /proc) -for d in /proc/[0-9]*; do c=$(tr '\0' ' ' < $d/cmdline 2>/dev/null); \ - case "$c" in *release/genenetwork4*) echo "${d#/proc/} $c";; esac; done +# who is actually serving (no ps here; read /proc, and match argv[0]) +for d in /proc/[0-9]*; do a0=$(tr '\0' '\n' < $d/cmdline 2>/dev/null | head -1); \ + case "$a0" in ./target/release/genenetwork4) echo "${d#/proc/}";; esac; done # and what is actually answering: git must be the commit you just built curl -s https://vesuvio.pu.ac.ke/gn4/version | jq -r '.data | "\(.git) \(.dirty)"' ``` +Match **argv[0] against the binary path**, not the whole command line: +`nohup env …` leaves a wrapper process whose command line also contains +that path, so a substring match finds the wrapper -- which is how the pid +file ended up naming a process that exits while the server keeps running. A `git` value older than the build you just made is this mistake, not a build problem: write the resolved pid into the pid file (and start the replacement only after `:3000` has stopped answering). `source_digest` -- cgit 1.4.1