[Samba] log.samba missing rotation

L.P.H. van Belle belle at bazuin.nl
Mon May 25 11:21:15 UTC 2020


Can you try this and adjust the path's in it. 


#/etc/logrotate.d/samba
/var/log/samba/log.smbd {
        weekly
        missingok
        rotate 7
        postrotate
                [ ! -x /usr/bin/smbcontrol ] || [ ! -f /run/samba/smbd.pid ] || /usr/bin/smbcontrol smbd reload-config
        endscript
        compress
        delaycompress
        notifempty
}

/var/log/samba/log.nmbd {
        weekly
        missingok
        rotate 7
        postrotate
                [ ! -x /usr/bin/smbcontrol ] || [ ! -f /run/samba/nmbd.pid ] || /usr/bin/smbcontrol nmbd reload-config
        endscript
        compress
        delaycompress
        notifempty
}

/var/log/samba/log.samba {
        weekly
        missingok
        rotate 7
        postrotate
                if [ -d /run/systemd/system ] && command systemctl >/dev/null 2>&1 && systemctl is-active --quiet samba-ad-dc; then
                        systemctl kill --kill-who all --signal=SIGHUP samba-ad-dc
                elif [ -f /run/samba/samba.pid ]; then
                        # This only sends to main pid, See #803924
                        kill -HUP `cat /run/samba/samba.pid`
                fi
        endscript
        compress
        delaycompress
        notifempty
}


#/etc/logrotate.d/winbind 
/var/log/samba/log.winbindd {
        weekly
        missingok
        rotate 7
        postrotate
                if [ -x /usr/bin/smbcontrol ]; then
                        /usr/bin/smbcontrol winbindd reload-config
                elif [ -f /run/samba/winbindd.pid ]; then
                        kill -HUP `cat /run/samba/winbindd.pid`
                fi
        endscript
        compress
        delaycompress
        notifempty
}


> -----Oorspronkelijk bericht-----
> Van: samba [mailto:samba-bounces at lists.samba.org] Namens 
> Lorenzo Milesi via samba
> Verzonden: maandag 25 mei 2020 13:11
> Aan: samba
> Onderwerp: Re: [Samba] log.samba missing rotation
> 
> > Looks like a known issue when running samba as AD DC:
> > https://bugzilla.samba.org/show_bug.cgi?id=9673
> 
> Altought it doesn't seem exactly my issue I've enabled logrotate.
> 
> This is my samba logging config:
> 
>         log level = 9
>         log file = /usr/local/samba/var/log.client.%m
>         max log size = 50000
> 
> 
> And this is my logrotate
> /usr/local/samba/var/log.samba {
>         daily
>         missingok
>         rotate 14
>         compress
>         notifempty
>         postrotate
>                 killall -SIGHUP smbd >/dev/null 2>&1
>         endscript
> }
> 
> Unfortunately after rotating log files the killall command 
> didn't have any effect, log.samba hasn't been created ever since.
> I tried smbcontrol all reload-config but the same, no 
> log.samba file anymore!
> 
> -- 
> Lorenzo Milesi - lorenzo.milesi at yetopen.it
> 
> YetOpen S.r.l. - https://www.yetopen.it/
> Via Salerno 18 - 23900 Lecco - ITALY -
> Tel +39 0341 220 205 - Fax +39 178 6070 222
> 
> Think green - Non stampare questa e-mail se non necessario / 
> Don't print this email unless necessary
> 
> -------- D.Lgs. 196/2003 e GDPR 679/2016 --------
> Tutte le informazioni contenute in questo messaggio sono 
> riservate ed a uso esclusivo del destinatario.
> Tutte le informazioni ivi contenute, compresi eventuali 
> allegati, sono da ritenere confidenziali e riservate secondo i termini
> del vigente D.Lgs. 196/2003 in materia di privacy e del 
> Regolamento europeo 679/2016 - GDPR - e quindi ne e' proibita 
> l'utilizzazione ulteriore non autorizzata.
> Nel caso in cui questo messaggio Le fosse pervenuto per 
> errore, La invitiamo ad eliminarlo senza copiarlo, stamparlo, 
> a non inoltrarlo a terzi e ad avvertirci non appena possibile.
> Grazie.
> 
> Confidentiality notice: this email message including any 
> attachment is for the sole use of the intended recipient and 
> may contain confidential and privileged information;
> pursuant to Legislative Decree 196/2003 and the European 
> General Data Protection Regulation 679/2016 - GDPR - any 
> unauthorized review, use, disclosure or distribution
> is prohibited. If you are not the intended recepient please 
> delete this message without copying, printing or forwarding 
> it to others, and alert us as soon as possible.
> Thank you.
> 
> 
> -- 
> To unsubscribe from this list go to the following URL and read the
> instructions:  https://lists.samba.org/mailman/options/samba
> 
> 




More information about the samba mailing list