<div id="RTEContent">Hi Alfred,<br><br><b><i>alfred hitch &lt;alfred.hitch@gmail.com&gt;</i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Hi Rushi,<br><br>thanks for your response.<br>We were invoking syslogd without any options. So, that will solve the<br>reap size etc.<br><br>1) BUT, the bigger issue of logs not coming still remain. Observations / test sequence is very simple.<br><br>-&gt; syslogd &amp;<br>-&gt; programs / daemons writting using syslog() functions.<br>-&gt; tail -f /var/log/messages &amp;<br>-&gt; We can see logs on screen till messages isnt moved to messages.old<br>After that we have to issue another tail -f /var/log/messages.<br>Last tail will also work only till another round of reap.<br><br>I am surprised noone has observed this. Is everyone using a big log file on their boxes ?<br></blockquote>This would happen on any unix machine.&nbsp; The tail program<br> never reopens the file
 being monitored.&nbsp; So when syslogd<br> rotates the log file(s), tail is left behind monitoring the wrong<br> log file.<br> <br> Step 1. The syslogd program in busybox checks the size each<br> time something is to be written to the current logfile.&nbsp; If the size<br> is too big it rotates the files.&nbsp;&nbsp; <br> mv __LOG_FILE.(n-1)&nbsp; __LOG_FILE.(n)<br> mv __LOG_FILE.(n-2)&nbsp; __LOG_FILE(n-1)<br> ....<br> ..<br> mv _LOG_FILE __LOG_FILE.0<br> <br> Step 2. Syslogd then opens a new logfile<br> Step 3. It starts writting to the new log file.<br> <br> So in your case if you pass no arguments to syslogd on startup<br> the default is to retain only one log file.<br> <br> Step 1. mv /var/log/messages /var/log/messages.0<br> Step 2. create a new log file /var/log/messages.<br> Step 3. append log message to /var/log/messages.<br> <br>  Tail is still looking at /var/log/messages.0 after the first<br> rotation, but after the 2nd rotation the reference to the<br> file is removed
 from the filesystem.<br> <blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>2) If one is to not write to flash very often for log messages. How does one works around to get messages across reboots for crashes / other info etc ? delayed writes (again will miss out of last cycle before crash ?)?<br> </blockquote> If you can log to another machine that would be best. <br> <br> Otherwise you have to write to the flash.&nbsp; You could write a<br> cron job that checks for the existance of /var/log/messages.0,<br> filters it for stuff you want to monitor, write the report to flash<br> and then removes /var/log/messsages.0<br> <br> Depending on how/why your system crashes, you could partition<br> your ram into a ram disk and then on boot up check if the ram<br> disk had a valid logfile in it.<br> <br> &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp;
 &nbsp;&nbsp; &nbsp;&nbsp; Max Okumoto<br> <br> <blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>Regards,<br>Alfred<br><br><br>On 12/23/05, Rushi Lala <rushi.lala @gmail.com=""> wrote:<br>&gt; Usage: syslogd [OPTION]...<br>&gt;<br>&gt; Linux system and kernel logging utility.<br>&gt; Note that this version of syslogd ignores /etc/syslog.conf.<br>&gt;<br>&gt; Options:<br>&gt;         -m MIN          Minutes between MARK lines (default=20, 0=off)<br>&gt;         -n              Run as a foreground process<br>&gt;         -O FILE         Use an alternate log file (default=/var/log/messages)<br>&gt;         -S              Make logging output smaller.<br>&gt;         -s SIZE         Max size (KB) before rotate (default=200KB, 0=off)<br>&gt;         -b NUM          Number of rotated logs to keep (default=1,<br>&gt; max=99, 0=purge)<br>&gt;         -R HOST[:PORT]  Log to IP or hostname on PORT (default
 PORT=514/UDP)<br>&gt;         -L              Log locally and via network logging (default<br>&gt; is network only)<br>&gt;         -C [size(KiB)]  Log to a circular buffer (read the buffer using logread)<br>&gt;<br>&gt;<br>&gt; I am using following options when i fire syslogd daemon from rcS<br>&gt; /etc/init.d/rcS<br>&gt;<br>&gt; klogd &amp;<br>&gt; syslogd -m 120 -S -s 250 -b 2 &amp;<br>&gt;<br>&gt;  -m 160       Minutes between MARK lines (default=20, 0=of)<br>&gt;  -S              Make logging output smaller.<br>&gt;  -s 250KB    Max size (KB) before rotate (default=200KB, 0=off)<br>&gt;  -b  2           Number of rotated logs to keep (default=1, max=99, 0=purge)<br>&gt;<br>&gt; tail -f should work if syslogd is updating the log file..........How<br>&gt; do you test this , i mean what events do you use to generate the<br>&gt; messages ?<br>&gt;<br>&gt; Rushi<br>&gt;<br>&gt; On 23/12/05, alfred hitch <alfred.hitch @gmail.com=""> wrote:<br>&gt; &gt; Hi,<br>&gt; &gt;<br>&gt; &gt;
 We have just started using busybox syslogd and tail etc ..<br>&gt; &gt; 2 Questions:<br>&gt; &gt;<br>&gt; &gt; 1) How to change the reap size after which syslogd shifts messages<br>&gt; &gt; from /var/log/messages to messages.old ? and then removes altogether ?<br>&gt; &gt; any option possible for runtime to syslogd<br>&gt; &gt;<br>&gt; &gt; 2) If I do a tail -f /var/log/messages and this file is "reap" ed in background.<br>&gt; &gt; I dont see any logs coming on screen, of course they are still going<br>&gt; &gt; to messages file. But, how to keep on getting these on screen also ..<br>&gt; &gt; some file handling desc. invalid issue ? any work arounds ?<br>&gt; &gt;<br>&gt; &gt; Regards,<br>&gt; &gt; Alfred<br>&gt; &gt; _______________________________________________<br>&gt; &gt; busybox mailing list<br>&gt; &gt; busybox@busybox.net<br>&gt; &gt; http://busybox.net/cgi-bin/mailman/listinfo/busybox<br>&gt; &gt;<br>&gt;<br>_______________________________________________<br>busybox
 mailing list<br>busybox@busybox.net<br>http://busybox.net/cgi-bin/mailman/listinfo/busybox<br></alfred.hitch></rushi.lala></blockquote> <br></div>