diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2021-11-22 10:04:18 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2021-11-22 10:08:50 +0200 |
commit | 280dbe51af67081a687a3f830864e803fc421b7b (patch) | |
tree | 64728765a3f8b486310c35a4c1210bc4bd0a7288 | |
parent | df0d52f807e5e34e4747b06dabb974caaca7443c (diff) | |
download | tallyman-master.tar.gz tallyman-master.tar.bz2 |
* src/tallyman.c (main): Do execvp if service ID is empty.
* src/tallyman.1: Document changes.
* NEWS: Document changes.
* configure.ac: Version 1.4
-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,8 +1,13 @@ -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" diff --git a/configure.ac b/configure.ac index 44d34b8..7e10ffe 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ # 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]) diff --git a/src/tallyman.1 b/src/tallyman.1 index 5e43695..2f9d794 100644 --- a/src/tallyman.1 +++ b/src/tallyman.1 @@ -1,4 +1,4 @@ -.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 @@ -75,6 +75,11 @@ In the absense of the 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 diff --git a/src/tallyman.c b/src/tallyman.c index 1536fcd..5803cb5 100644 --- a/src/tallyman.c +++ b/src/tallyman.c @@ -270,10 +270,16 @@ main(int argc, char **argv) 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"); |