Closed fiisch closed 2 months ago
I managed to isolate and correct the problem - argument parsing in the pinguctl.c source. Patch attached. Please check it to make sure I didn't commit some C heresy. ;)
If you rather have me submit a pull request, just let me know.
diff --git a/src/pinguctl.c b/src/pinguctl.c
index ea59f8a..5f79a38 100644
--- a/src/pinguctl.c
+++ b/src/pinguctl.c
@@ -71,15 +71,17 @@ int main(int argc, char *argv[])
socket_path = optarg;
break;
}
- argc -= optind;
- argv += optind;
}
+
+ argc -= optind;
+ argv += optind;
+
log_init("pinguctl", 0);
fd = adm_init(socket_path);
if (fd < 0)
return 1;
- for (i = 1; i < argc; i++) {
+ for (i = 0; i < argc; i++) {
if (adm_send_cmd(fd, argv[i]) < 0 || adm_recv(fd) < 0)
return 1;
}
Hi, I am using pingu with non-default paths, set -a for the admin socket and pointed it to
/var/run/pingu/pingu-2.ctl
. Pingu daemon runs fine but I am not able to query status info with pinguctl. When runningpinguctl -a /var/run/pingu/pingu-2.ctl gateway-status
the return code is 0 but no info is printed. Pinguctl successfuly opens the socket and then closes it right away. When I have socket in the default location,pinguctl gateway-status
works fine butpinguctl -a path_to_default_socket_location gateway-status
fails. Command specificaton (host-status, gateway-status does not matter).Using git.8c9b53c built on CentOS7.
systemd unit:
strace of failing pinguctl (notice missing commnication with socket):