From: Valentine Krasnobaeva Date: Sun, 22 Sep 2024 10:38:35 +0000 (+0200) Subject: MINOR: debug: show boot and runtime process settings in table X-Git-Tag: v3.2-dev4~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8620ae79628c13c84f68f981d92eb5bb71e81499;p=thirdparty%2Fhaproxy.git MINOR: debug: show boot and runtime process settings in table Let's reformat output of "show dev" in order to show some boot and runtime process settings in a table. This makes the output less crowded. --- diff --git a/src/debug.c b/src/debug.c index 6434106a9..a6a2c3f88 100644 --- a/src/debug.c +++ b/src/debug.c @@ -596,12 +596,6 @@ static int debug_parse_cli_show_dev(char **args, char *payload, struct appctx *a for (i = 0; i < post_mortem.process.argc; i++) chunk_appendf(&trash, "%s ", post_mortem.process.argv[i]); chunk_appendf(&trash, "\n"); - - chunk_appendf(&trash, " boot uid: %d\n", post_mortem.process.boot_uid); - chunk_appendf(&trash, " runtime uid: %d\n", post_mortem.process.run_uid); - chunk_appendf(&trash, " boot gid: %d\n", post_mortem.process.boot_gid); - chunk_appendf(&trash, " runtime gid: %d\n", post_mortem.process.run_gid); - #if defined(USE_LINUX_CAP) /* let's dump saved in feed_post_mortem() initial capabilities sets */ if(!post_mortem.process.caps.err_boot) { @@ -635,25 +629,25 @@ static int debug_parse_cli_show_dev(char **args, char *payload, struct appctx *a chunk_appendf(&trash, " capget() failed at runtime with: %s.\n", errname(post_mortem.process.caps.err_run, &err)); #endif - chunk_appendf(&trash, " boot limits:\n"); - chunk_appendf(&trash, " \tfd limit (soft): %s\n", - LIM2A(normalize_rlim(post_mortem.process.boot_lim_fd.rlim_cur), "unlimited")); - chunk_appendf(&trash, " \tfd limit (hard): %s\n", - LIM2A(normalize_rlim(post_mortem.process.boot_lim_fd.rlim_max), "unlimited")); - chunk_appendf(&trash, " \tram limit (soft): %s\n", - LIM2A(normalize_rlim(post_mortem.process.boot_lim_ram.rlim_cur), "unlimited")); - chunk_appendf(&trash, " \tram limit (hard): %s\n", - LIM2A(normalize_rlim(post_mortem.process.boot_lim_ram.rlim_max), "unlimited")); - - chunk_appendf(&trash, " runtime limits:\n"); - chunk_appendf(&trash, " \tfd limit (soft): %s\n", - LIM2A(normalize_rlim(post_mortem.process.run_lim_fd.rlim_cur), "unlimited")); - chunk_appendf(&trash, " \tfd limit (hard): %s\n", - LIM2A(normalize_rlim(post_mortem.process.run_lim_fd.rlim_max), "unlimited")); - chunk_appendf(&trash, " \tram limit (soft): %s\n", - LIM2A(normalize_rlim(post_mortem.process.run_lim_ram.rlim_cur), "unlimited")); - chunk_appendf(&trash, " \tram limit (hard): %s\n", - LIM2A(normalize_rlim(post_mortem.process.run_lim_ram.rlim_max), "unlimited")); + + chunk_appendf(&trash, " %-22s %-11s %-11s \n", "identity:", "-boot-", "-runtime-"); + chunk_appendf(&trash, " %-22s %-11d %-11d \n", " uid:", post_mortem.process.boot_uid, + post_mortem.process.run_uid); + chunk_appendf(&trash, " %-22s %-11d %-11d \n", " gid:", post_mortem.process.boot_gid, + post_mortem.process.run_gid); + chunk_appendf(&trash, " %-22s %-11s %-11s \n", "limits:", "-boot-", "-runtime-"); + chunk_appendf(&trash, " %-22s %-11s %-11s \n", " fd limit (soft):", + LIM2A(normalize_rlim((ulong)post_mortem.process.boot_lim_fd.rlim_cur), "unlimited"), + LIM2A(normalize_rlim((ulong)post_mortem.process.run_lim_fd.rlim_cur), "unlimited")); + chunk_appendf(&trash, " %-22s %-11s %-11s \n", " fd limit (hard):", + LIM2A(normalize_rlim((ulong)post_mortem.process.boot_lim_fd.rlim_max), "unlimited"), + LIM2A(normalize_rlim((ulong)post_mortem.process.run_lim_fd.rlim_max), "unlimited")); + chunk_appendf(&trash, " %-22s %-11s %-11s \n", " ram limit (soft):", + LIM2A(normalize_rlim((ulong)post_mortem.process.boot_lim_ram.rlim_cur), "unlimited"), + LIM2A(normalize_rlim((ulong)post_mortem.process.run_lim_ram.rlim_cur), "unlimited")); + chunk_appendf(&trash, " %-22s %-11s %-11s \n", " ram limit (hard):", + LIM2A(normalize_rlim((ulong)post_mortem.process.boot_lim_ram.rlim_max), "unlimited"), + LIM2A(normalize_rlim((ulong)post_mortem.process.run_lim_ram.rlim_max), "unlimited")); ha_free(&err);