I am posting here as firstname.lastname@example.org bounced. I am using nhc 1.4.2 on a centos7 system. using bash
Our logs are filling up with many smash stacking errors, I traced the problem to /opt/nhc-1.4.2/sbin/nhc
about line 143. which produces a command like
kill -s USR2 -- -17525 17525
where the problem occurs
Is anyone able to give us any guidance as to how to resolve this issue?
nhcscript in 1.4.2, in part due to the fact that it was triggering some weird bug in Bash.
check_file_contents()wasn't really written with log files in mind, and unfortunately
bashdoesn't have an ability to
seek()within an existing file to a particular spot, so I'd have to skip a user-specified number of lines. And even then, that wouldn't allow me to track "recent" changes. Nothing in Linux/UNIX tracks when different parts of a file were written (at least not generically and in a way userland programs could query it), so the only way to track that would require (1) saving state, and (2) a way in
bashto seek to a byte value in a file.
seek()to that position on startup and output the rest of the file. Then NHC's
check_cmd_output()could be used to assert that your search string wasn't in the new portion of the file. Should be pretty trivial to write. In fact, apart from the tracking-where-to-seek-to portion,
tail -ccan do exactly that (dump the remainder of a file to stdout).
* || read LOG_FILE_LINES < /tmp/log_file_lines.tmp && wc -l /path/to/file > /tmp/log_file_lines.tmp && check_cmd_output -m '!/error you want to look for/' tail -n +$LOG_FILE_LINES /path/to/file