freeipmi: add "no-restart" (workaround #17931) (#18057)
Ilya Mashchenko committed
Jul 1, 2024 at 23:51 UTC
66a750fcf7e8cf3e6b432efed2938b12a27a87e1
1 file changed
+9
-1
src/collectors/freeipmi.plugin/freeipmi_plugin.c
+9
-1
@@ -1652,6 +1652,10 @@ int main (int argc, char **argv) {
1652
1653
bool debug = false;
1654
1655
+ // TODO: Workaround for https://github.com/netdata/netdata/issues/17931
1656
+ // This variable will be removed once the issue is fixed.
1657
+ bool restart_every = true;
1658
+
1659
// ------------------------------------------------------------------------
1660
// parse command line parameters
1661
@@ -1672,6 +1676,10 @@ int main (int argc, char **argv) {
1676
debug = true;
1677
continue;
1678
}
1679
+ else if(strcmp("no-restart", argv[i]) == 0) {
1680
+ restart_every = false;
1681
+ continue;
1682
+ }
1683
else if(strcmp("sel", argv[i]) == 0) {
1684
netdata_do_sel = true;
1685
continue;
@@ -2100,7 +2108,7 @@ int main (int argc, char **argv) {
2108
"END\n");
2109
2110
// restart check (14400 seconds)
2103
- if (now_monotonic_sec() - started_t > IPMI_RESTART_EVERY_SECONDS) {
2111
+ if (restart_every && (now_monotonic_sec() - started_t > IPMI_RESTART_EVERY_SECONDS)) {
2112
collector_info("%s(): reached my lifetime expectancy. Exiting to restart.", __FUNCTION__);
2113
fprintf(stdout, "EXIT\n");
2114
plugin_exit(0);