summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2013-03-20 18:10:17 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2013-03-20 18:10:17 +0100
commitb96674bbc9439f107c700d75e69268ee75e0387e (patch)
treeb92f5aa248d02f9078c7c034c0117c3348cec529
parent3e0c277d3606b3dd871ac3b3d5bf6fe872778eb2 (diff)
downloadrsyslog-b96674bbc9439f107c700d75e69268ee75e0387e.tar.gz
rsyslog-b96674bbc9439f107c700d75e69268ee75e0387e.tar.bz2
rsyslog-b96674bbc9439f107c700d75e69268ee75e0387e.zip
imfile: errors persisting state file are now reported
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=292
-rw-r--r--ChangeLog2
-rw-r--r--plugins/imfile/imfile.c8
2 files changed, 10 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 5d4d4747..8138202b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,8 @@ Version 7.3.9 [devel] 2013-03-??
- imuxsock: add ability to NOT create/delete sockets during startup and
shutdown
closes: http://bugzilla.adiscon.com/show_bug.cgi?id=259
+- imfile: errors persisting state file are now reported
+ closes: http://bugzilla.adiscon.com/show_bug.cgi?id=292
- imfile: now detects file change when rsyslog was inactive
Previosly, this case could not be detected, so if a file was overwritten
or rotated away while rsyslog was stopped, some data was missing. This
diff --git a/plugins/imfile/imfile.c b/plugins/imfile/imfile.c
index 6ce08fd4..349acead 100644
--- a/plugins/imfile/imfile.c
+++ b/plugins/imfile/imfile.c
@@ -739,12 +739,20 @@ persistStrmState(fileInfo_t *pInfo)
CHKiRet(strm.ConstructFinalize(psSF));
CHKiRet(strm.Serialize(pInfo->pStrm, psSF));
+ CHKiRet(strm.Flush(psSF));
CHKiRet(strm.Destruct(&psSF));
finalize_it:
if(psSF != NULL)
strm.Destruct(&psSF);
+
+ if(iRet != RS_RET_OK) {
+ errmsg.LogError(0, iRet, "imfile: could not persist state "
+ "file %s - data may be repeated on next "
+ "startup. Is WorkDirectory set?",
+ pInfo->pszStateFile);
+ }
RETiRet;
}