2012/3/13 Rainer Gerhards <[email protected]>: > > >> -----Original Message----- >> From: [email protected] [mailto:rsyslog- >> [email protected]] On Behalf Of Kaiwang Chen >> Sent: Tuesday, March 13, 2012 2:28 PM >> To: rsyslog-users >> Subject: Re: [rsyslog] lots of queue files left in working directory >> >> 2012/3/13 Rainer Gerhards <[email protected]>: >> > [snip] >> >> Anyway, I will verify it. >> > If your run 5.8.6, no need to verify as you are not affected. I will >> try to >> > reproduce the issue with that version, but I will then probably need >> a debug >> > log from you, as I tried yesterday and the problem disappeared once >> the fix >> > went in. >> >> I found the disk queue index file (mq.qi in my ase) was lost, as a >> result qqueueTryLoadPersistedInfo() failed to detect the queue >> files... >> With full list of mq.<number>, is it possible to assemble the >> corresponding index named mq.qi? Although the reason why it was >> missing remains unknown, I'd better have the queue recovered. > > Unfortunately, there currently is no function to rebuild the .qi file. It is > not really hard to do manually. I'll check if I can extract the necessary > information.
I worked out a tool(enclosed) to help rebuild .qi file, in my case:
# perl recover_qi.pl -w /var/spool/rsyslog/ -f mq -d 8 >/var/spool/rsyslog/mq.qi
# cat /var/spool/rsyslog/mq.qi
<OPB:1:qqueue:1:
+iQueueSize:2:7:8726880:
+tVars.disk.bytesRead:2:1:0:
+tVars.disk.sizeOnDisk:2:10:4124216524:
>End
.
<Obj:1:strm:1:
+tOperationsMode:2:1:4:
+iMaxFiles:2:8:10000000:
+bDeleteOnClose:2:1:0:
+pszFName:1:2:mq:
+tOpenMode:2:3:384:
+iCurrFNum:2:3:787:
+sType:2:1:1:
+iCurrOffs:2:7:3125007:
>End
.
<Obj:1:strm:1:
+tOperationsMode:2:1:1:
+iMaxFiles:2:8:10000000:
+bDeleteOnClose:2:1:1:
+pszFName:1:2:mq:
+tOpenMode:2:3:384:
+iCurrFNum:2:1:1:
+sType:2:1:1:
+iCurrOffs:2:1:0:
>End
.
# perl recover_qi.pl -h
Usage:
recover_qi.pl -w WorkDirectory -f QueueFileName -d 8 > QueueFileName.qi
However, I have no idea why the last queue file mq.00000787 was not
deleted after last entry had been delivered. So did the mq.qi file.
Both failed to survive across restart though.
When rsyslogd was busy processing disk queue, I sent a message vai
logger(1), it almost immediately appeared in the /var/log/messages
file. Why? Shouldn't it appear after the disk queue entries?
>
> Rainer
> _______________________________________________
> rsyslog mailing list
> http://lists.adiscon.net/mailman/listinfo/rsyslog
> http://www.rsyslog.com/professional-services/
Thanks,
Kaiwang
recover_qi.pl
Description: Binary data
_______________________________________________ rsyslog mailing list http://lists.adiscon.net/mailman/listinfo/rsyslog http://www.rsyslog.com/professional-services/

