diff options
-rw-r--r-- | NEWS | 7 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | src/tallyman.1 | 7 | ||||
-rw-r--r-- | src/tallyman.c | 8 |
4 files changed, 20 insertions, 4 deletions
@@ -1,11 +1,16 @@ -tallyman -- history of user-visible changes. 2021-02-05 +tallyman -- history of user-visible changes. 2021-11-22 See the end of file for copying conditions. Please send tallyman bug reports to <gray+tallyman@gnu.org.ua> +Version 1.4, 2021-11-22 + +* tallyman: if passed empty service ID, don't attempt to contact the collector + + Version 1.3, 2021-02-05 * New statement "snmp-client-config" Supplies the file with SNMP client configuration parameters. diff --git a/configure.ac b/configure.ac index 44d34b8..7e10ffe 100644 --- a/configure.ac +++ b/configure.ac @@ -2,13 +2,13 @@ # Copyright (C) 2018-2021 Sergey Poznyakoff # License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> # This is free software: you are free to change and redistribute it. # There is NO WARRANTY, to the extent permitted by law. AC_PREREQ([2.69]) -AC_INIT([tallyman], [1.3], [gray+tallyman@gnu.org]) +AC_INIT([tallyman], [1.4], [gray+tallyman@gnu.org]) AC_CONFIG_SRCDIR([src/tallyman.c]) AC_CONFIG_HEADERS([config.h]) AM_INIT_AUTOMAKE([1.15 foreign]) # Checks for programs. AC_PROG_CC diff --git a/src/tallyman.1 b/src/tallyman.1 index 5e43695..2f9d794 100644 --- a/src/tallyman.1 +++ b/src/tallyman.1 @@ -1,7 +1,7 @@ -.TH TALLYMAN 1 "October 10, 2020" "TALLYMAN" "Tallyman User Reference" +.TH TALLYMAN 1 "November 22, 2021" "TALLYMAN" "Tallyman User Reference" .SH NAME tallyman \- health state collector for docker containers .SH SYNOPSIS .na .nh \fBtallyman\fR\ @@ -72,12 +72,17 @@ details. .PP In the absense of the .B \-s option, .B tallyman will send statistics to the container's default gateway, port 8990. +.PP +As a special case, if given empty string as \fISRVID\fR, +\fBtallyman\fR will run the supplied command via a call to +.BR execv (3), +without making any attempt to contact the collector. .SS Diagnostics The program attempts to be as transparent as it is reasonable. It will display diagnostic messages on the standard error if it is unable to connect to the collector or if the communication with it does not succeed, or if the .I COMMAND diff --git a/src/tallyman.c b/src/tallyman.c index 1536fcd..5803cb5 100644 --- a/src/tallyman.c +++ b/src/tallyman.c @@ -267,16 +267,22 @@ main(int argc, char **argv) if (argc == 0) usage_error("required argument missing"); service_id = *argv; argc--; argv++; - + if (argc == 0) usage_error("no program given"); + if (*service_id == 0) { + execvp(argv[0], argv); + system_error(errno, "failed to run %s", argv[0]); + exit(127); + } + if (!hostname) { if (get_hostname(&hostname)) { system_error(errno, "hostname"); exit(1); } } |