mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 06:11:32 +02:00
MINOR: cli: change 'show proc' output of old processes
Change the output of the relative pid for the old processes, displays "[was: X]" instead of just "X" which was confusing if you want to connect to the CLI of an old PID.
This commit is contained in:
parent
2a59e87735
commit
256bf0d37b
@ -2505,7 +2505,7 @@ Example:
|
|||||||
1271 worker 1 0 0d 00h00m00s
|
1271 worker 1 0 0d 00h00m00s
|
||||||
1272 worker 2 0 0d 00h00m00s
|
1272 worker 2 0 0d 00h00m00s
|
||||||
# old workers
|
# old workers
|
||||||
1233 worker 1 3 0d 00h00m43s
|
1233 worker [was: 1] 3 0d 00h00m43s
|
||||||
|
|
||||||
|
|
||||||
In this example, the master has been reloaded 5 times but one of the old
|
In this example, the master has been reloaded 5 times but one of the old
|
||||||
|
11
src/cli.c
11
src/cli.c
@ -1426,11 +1426,13 @@ static int cli_io_handler_show_proc(struct appctx *appctx)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
chunk_appendf(&trash, "%-15u %-15s %-15u %-15d %dd %02dh%02dm%02ds\n", child->pid, "worker", child->relative_pid, child->reloads, up / 86400, (up % 86400) / 3600, (up % 3600) / 60, (up % 60));
|
chunk_appendf(&trash, "%-15u %-15s %-15u %-15d %dd %02dh%02dm%02ds\n", child->pid, "worker", child->relative_pid, child->reloads, up / 86400, (up % 86400) / 3600, (up % 3600) / 60, (up % 60));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* displays old processes */
|
/* displays old processes */
|
||||||
|
|
||||||
if (old) {
|
if (old) {
|
||||||
|
char *msg = NULL;
|
||||||
|
|
||||||
chunk_appendf(&trash, "# old workers\n");
|
chunk_appendf(&trash, "# old workers\n");
|
||||||
list_for_each_entry(child, &proc_list, list) {
|
list_for_each_entry(child, &proc_list, list) {
|
||||||
up = now.tv_sec - child->timestamp;
|
up = now.tv_sec - child->timestamp;
|
||||||
@ -1438,10 +1440,13 @@ static int cli_io_handler_show_proc(struct appctx *appctx)
|
|||||||
if (child->type != 'w')
|
if (child->type != 'w')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (child->reloads > 0)
|
if (child->reloads > 0) {
|
||||||
chunk_appendf(&trash, "%-15u %-15s %-15u %-15d %dd %02dh%02dm%02ds\n", child->pid, "worker", child->relative_pid, child->reloads, up / 86400, (up % 86400) / 3600, (up % 3600) / 60, (up % 60));
|
memprintf(&msg, "[was: %u]", child->relative_pid);
|
||||||
|
chunk_appendf(&trash, "%-15u %-15s %-15s %-15d %dd %02dh%02dm%02ds\n", child->pid, "worker", msg, child->reloads, up / 86400, (up % 86400) / 3600, (up % 3600) / 60, (up % 60));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
free(msg);
|
||||||
|
}
|
||||||
|
|
||||||
if (ci_putchk(si_ic(si), &trash) == -1) {
|
if (ci_putchk(si_ic(si), &trash) == -1) {
|
||||||
si_rx_room_blk(si);
|
si_rx_room_blk(si);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user