[LDAPGTF] Petite question technique

Clément OUDOT clem.oudot at gmail.com
Mer 16 Sep 11:15:09 CEST 2009


Le 16 septembre 2009 10:55, Emmanuel Lecharny <elecharny at apache.org> a écrit :
> Clément OUDOT wrote:
>>
>> Le 15 septembre 2009 23:26, Emmanuel Lecharny <elecharny at apache.org> a
>> écrit :
>>
>>>
>>> Clément OUDOT wrote:
>>>
>>>>>
>>>>> Tu peux aussi ajouter un "-" devant le chemin du fichier pour que les
>>>>> logs
>>>>> soient asynchrones - ca donne un gain de perfs si le serveur logge
>>>>> beaucoup.
>>>>>
>>>>> J'espère que ca t'aide.
>>>>>
>>>>>
>>>>>
>>>>
>>>> Salut,
>>>>
>>>> pour le logrotate, j'ai eu des surprises, aussi je fais un restart de
>>>> syslog pour tourner les logs OpenLDAP :
>>>>
>>>>
>>>> http://tools.ltb-project.org/repositories/entry/ltb/openldap-rpm/trunk/SOURCES/openldap.logrotate
>>>>
>>>> Et pour info, les RPMs fournis dans LTB-project gère automatiquement
>>>> les logs OpenLDAP dans syslog et le logrotate ;)
>>>>
>>>>
>>>
>>> Merci à tous les deux.
>>>
>>> Question Clément :
>>>
>>> if test -n "`ps acx|grep slapd`"; then
>>>    /sbin/service slapd restart
>>>
>>>
>>> c'est pas un peu brutal ?
>>>
>>> Je confirme sinon que j'ai un problème avec logrotate : en fait la
>>> rotation
>>> ne marche tout simplement pas tant que OpenLDAP tient le fichier. (Merci
>>> the
>>> FileSystem full ;). En tout cas, si je ne passe pas par syslog.
>>>
>>
>>
>> J'ai l'impression qu'il faut relancer forcément OpenLDAP,
>
> :/ Ca pue... Même si c'est rapide à redémarrer, c'est franchement pas top.
> Je vais essayer de voir ça avec Howard ce week-end.
>
>> même en
>> passant par syslog, pour pouvoir démarrer sur un nouveau fichier de
>> log. Je suis preneur d'optimisation sur mon fichier de logroate (c'est
>> libre :) )
>>
>
> Voilà mon logRotate :
>
> /var/log/openldap/ldap.log {
>
>   rotate 7
>
>   daily
>
>   dateext
>
>   compress
>
>   notifempty
>
>   create 640 openldap openldap
>
>   missingok
>
> }
>
> Je me demande si l'utilisation de la commande* copytruncate* au lieu de
> create ne résoudrait pas le problème :
>
>     *copytruncate*
>             Truncate  the  original log file in place after creating a copy,
>             instead of moving the old log file and optionally creating a new
>             one,  It  can be used when some program can not be told to close
>             its logfile and thus might continue writing (appending)  to  the
>             previous log file forever.  Note that there is a very small time
>             slice between copying the file and truncating it, so  some  log-
>             ging  data  might be lost.  When this option is used, the
> *create*
>             option will have no effect, as the old log file stays in  place.
>
> Il resterait juste à positionner les mon droits dans un postrotate...
>
> thoughts ?


A tester, ça semble intéressant. Il faut voir si le copytruncate est
disponible dans tous les logrotate (en fonction des versions, des
distributions, etc.)

Je n'ai pas trop l'occasion de tester, mais je suis preneur de tes retours.

Clément.


More information about the LDAPGTF mailing list