In some cases, the logrotate is not fast enough rotating the
logfile after sighub has been send to inputfilegen process. It appears
to happen more often on github CI machines, when it happens,
inputfilegen reopens the NOT yet rotated file and keeps writing
into it. However most messages written until the next sighub are lost
after the logfile finally is rotated.
In order to avoid this, I have added an extra sleep between file
CLOSE and OPEN after sighub with a default of 5ms which appears to work
very well. This should give logrotate enough time to perform the
actuzal rotate.
Also added another parameter to inputfilegen to keep the process
open after finish. Which helps syncing with the testcases.
closes: https://github.com/rsyslog/rsyslog/issues/5000
Added check for IN_MOVED_TO in in_handleDirEvent. Statefilename and
event cookie are saved in IN_MOVE_FROM event in a linkedlist now,
so the statefile can be renamed to a new name in IN_MOVED_TO event.
Closes https://github.com/rsyslog/rsyslog/issues/1417