[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Big Logs



GG Noris (gigi@pclinx.it) wrote:
> I thik is a stupid question but i do not find a clear response:
> 
> I use RH 7.3, with openldap 2.0.23
> 
> I need to rotate the /var/log/ldap.log, but i do not find the script to
> put in /etc/logrotate.d/
> 
> Or there is another method ???

Yep. Run slapd under daemontools and use multilog.

$ cat run
#!/bin/sh
exec 2>&1 \
sh -c '
        exec \
        /usr/local/libexec/slapd -d 16 -f
/usr/local/openldap/etc/slapd.conf
'

$ cat log/run                   
#!/bin/sh                       
exec \                          
envdir ./env \                  
sh -c '                         
    exec \                      
    multilog \                  
        t \                     
        ${MAXFILESIZE+"s$MAXFILESIZE"} \
        ${MAXLOGFILES+"n$MAXLOGFILES"} \
        ./main                  
'

$ cat log/env/MAXFILESIZE 
1000000

$ cat log/env/MAXLOGFILES 
10


That setup keeps 10x1mb logfiles. 

-- 
Mike