Skip to content

Commit

Permalink
eve-tool: only pkill oldest zedbox
Browse files Browse the repository at this point in the history
we saw that a child process of zedbox got killed with USR2
(no signal handler defaults to SIGTERM).

My theory is that the following happened:
1. zedbox called fork()
2. now there are two zedbox processes
3. pkill finds two zedbox processes
4. child process of zedbox calls exec and remove USR2 handler
5. pkill sends USR2 to both PIDs
6. zedbox starts http debug as usual
7. child process (now supposed to do something different) gets killed

perhaps fixes #4002

Signed-off-by: Christoph Ostarek <christoph@zededa.com>
  • Loading branch information
christoph-zededa committed Jun 26, 2024
1 parent e66b1fa commit 67408df
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/dom0-ztools/rootfs/bin/eve
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ http_debug_request() {
fi

if [ "$running" = "0" ]; then
pkill -USR2 zedbox
pkill -o -USR2 zedbox
fi

printf "POST %s HTTP/1.0\r\n\r\n" "$URL" | nc 127.1 6543
Expand Down Expand Up @@ -230,7 +230,7 @@ __EOT__
fi
;;
http-debug) if [ -z "$2" ] || [ "$2" = "start" ]; then
pkill -USR2 zedbox
pkill -o -USR2 zedbox
echo "Listening on :6543 -- use 'eve http-debug stop' to stop"
elif [ "$2" = "stop" ]; then
printf "POST /stop HTTP/1.0\r\n\r\n" | nc 127.1 6543
Expand All @@ -247,7 +247,7 @@ __EOT__
echo "Your information can be found in logread"
;;
memory-monitor-update-config)
pkill -SIGHUP /sbin/memory-monitor
pkill -o -SIGHUP /sbin/memory-monitor
echo "Updated memory-monitor configuration"
;;
verbose) # first lets find our piping process
Expand Down

0 comments on commit 67408df

Please sign in to comment.