[stunnel-users] Stunnel log file limit

Michael D. Setzer II mikes at kuentos.guam.net
Thu Jul 18 12:26:06 CEST 2013

On 18 Jul 2013 at 11:49, mehmet ozisik wrote:

Date sent:	Thu, 18 Jul 2013 11:49:29 +0300
From:	mehmet ozisik <mehmetzsk at gmail.com>
To:	Michal Trojnara <Michal.Trojnara at mirt.net>
Copies to:	stunnel-users at stunnel.org
Subject:	Re: [stunnel-users] Stunnel log file limit

> Hi Michal, 
> I am running stunnel on a minimal system which has limited flash size,
> so using extra binary is expensive for me. I know those mechanisms
> there are on linux. But I am asking something like this within stunnel
> codes : While stunnel running it will check also log size, then when
> stunnel realized the log size limit (which is defined in conf file for
> example) reached it will re-open the log file in write mode (by the
> way old info will be deleted).
> Regards
> Mehmet

I did some testing, and this is what I came up with that seems to 
work. Original had just tried deleting the log file, but then later 
usage of stunnel would not add to the file. truncate seems to keep 
the file in a state were stunnel will continue. I used 473 since that 
is the size of my stunnel.log after an original startup. I also just 
used 50000 as a limit size for no real reason.

if [ `ls -l /var/log/stunnel.log | awk '{print $5}'` -gt 50000 ] ; then 
   truncate -c -s 473 /var/log/stunnel.log

Don't know if you current setup has awk or truncate, so it might 
also add a little size. Probable other ways to get the file size, and 
you could then run it with cron, or add a sleep option, and have it 
call itself.

> 2013/7/18 Michal Trojnara <Michal.Trojnara at mirt.net>
>     mehmet ozisik wrote:
>     I mean for linux also stunnels self log rotation. 
>     Could you please inform me?
>     Try:
>     https://www.google.com/search?q=linux+log+file+rotation 
>     Mike
>     _______________________________________________
>     stunnel-users mailing list
>     stunnel-users at stunnel.org
>     https://www.stunnel.org/cgi-bin/mailman/listinfo/stunnel-users

  Michael D. Setzer II -  Computer Science Instructor      
  Guam Community College  Computer Center                  
  mailto:mikes at kuentos.guam.net                            
  mailto:msetzerii at gmail.com
  Guam - Where America's Day Begins                        
  G4L Disk Imaging Project maintainer 

http://setiathome.berkeley.edu (Original)
Number of Seti Units Returned:  19,471
Processing time:  32 years, 290 days, 12 hours, 58 minutes
(Total Hours: 287,489)

SETI        15449173.944312   |   EINSTEIN    12398299.479852
ROSETTA      7976197.637931   |   ABC         16155563.883398

More information about the stunnel-users mailing list