about summary refs log tree commit diff
path: root/docs
diff options
context:
space:
mode:
authorPjotr <wrk@bosa.lan>2026-11-08 15:52:36 +0000
committerPjotr <wrk@bosa.lan>2026-11-08 15:52:36 +0000
commit0769a0ea0a8654e5e50e03365545c8ccf58d6b91 (patch)
treebfdfb13eaa85c277d64ba6972577e4ca71a49eec /docs
parentcfe873f6d60820f258a154e9c89c519687cb23c6 (diff)
downloadgenenetwork4-0769a0ea0a8654e5e50e03365545c8ccf58d6b91.tar.gz
docs: match the server by argv[0], not by a substring of its command line
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.
Diffstat (limited to 'docs')
-rw-r--r--docs/www/operator-checklist.md10
1 files changed, 7 insertions, 3 deletions
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`