Bonjour,
voici mon problème résumé dans le titre : logrotate ne se lance pas.
Je suis en sid à jour (18-11-13), et j’ai remarqué il y a quelques jours que les fichiers
/var/log/syslog et /var/log/messages notamment faisaient 200Mo et qu’ils
n’avaient jamais subi de rotation depuis l’installation du poste (fev 2013)
j’ai logrotate d’installé, avec la config par défaut (pour syslog par exemple c’est tous les jours normalement)
si je le lance à la main
([mono]#logrotate -f /etc/logrotate.conf[/mono]) ,
ça fonctionne, mais sinon il ne se lance pas tout seul
j’ai vérifié que le fichier [mono]/etc/cron.daily/logrotate[/mono] était présent, toujours dans la configuration par défaut.
crontab me dit que la les fichiers cron.daily doivent etre lancés à 6h25 tous les jours
Comme c’est mon poste de chez moi, il n’est pas allumé en permanence et rarement à 6h25…
d’où mes questions
- est-ce que logrotate est lancé automatiquement au démarrage du système?
- est-ce normal que sur ce poste il ne soit jamais lancé automatiquement?
en bonus, voici une copie du résultat de
[code]# logrotate -d /etc/logrotate.conf
reading config file /etc/logrotate.conf
including /etc/logrotate.d
reading config file apt
reading config file aptitude
reading config file consolekit
reading config file cups-daemon
reading config file dpkg
reading config file exim4-base
reading config file exim4-paniclog
reading config file pm-utils
reading config file rsyslog
Handling 14 logs
rotating pattern: /var/log/apt/term.log monthly (12 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/apt/term.log
log does not need rotating
rotating pattern: /var/log/apt/history.log monthly (12 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/apt/history.log
log does not need rotating
rotating pattern: /var/log/aptitude monthly (6 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/aptitude
log does not need rotating
rotating pattern: /var/log/ConsoleKit/history monthly (6 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/ConsoleKit/history
log does not need rotating
rotating pattern: /var/log/cups/*log after 1 days (7 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/cups/access_log
log does not need rotating
considering log /var/log/cups/cups-pdf_log
log does not need rotating
considering log /var/log/cups/error_log
log needs rotating
considering log /var/log/cups/page_log
log does not need rotating
rotating log /var/log/cups/error_log, log->rotateCount is 7
dateext suffix '-20131118’
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /var/log/cups/error_log.7.gz to /var/log/cups/error_log.8.gz (rotatecount 7, logstart 1, i 7),
renaming /var/log/cups/error_log.6.gz to /var/log/cups/error_log.7.gz (rotatecount 7, logstart 1, i 6),
renaming /var/log/cups/error_log.5.gz to /var/log/cups/error_log.6.gz (rotatecount 7, logstart 1, i 5),
renaming /var/log/cups/error_log.4.gz to /var/log/cups/error_log.5.gz (rotatecount 7, logstart 1, i 4),
renaming /var/log/cups/error_log.3.gz to /var/log/cups/error_log.4.gz (rotatecount 7, logstart 1, i 3),
renaming /var/log/cups/error_log.2.gz to /var/log/cups/error_log.3.gz (rotatecount 7, logstart 1, i 2),
renaming /var/log/cups/error_log.1.gz to /var/log/cups/error_log.2.gz (rotatecount 7, logstart 1, i 1),
renaming /var/log/cups/error_log.0.gz to /var/log/cups/error_log.1.gz (rotatecount 7, logstart 1, i 0),
running prerotate script
running script with arg /var/log/cups/*log : "
if [ -e /var/run/cups/cupsd.pid ]; then
invoke-rc.d --quiet cups stop > /dev/null
touch /var/run/cups/cupsd.stopped
fi
"
renaming /var/log/cups/error_log to /var/log/cups/error_log.1
creating new /var/log/cups/error_log mode = 0640 uid = 0 gid = 110
running postrotate script
running script with arg /var/log/cups/*log : "
if [ -e /var/run/cups/cupsd.stopped ]; then
rm /var/run/cups/cupsd.stopped
invoke-rc.d --quiet cups start > /dev/null
sleep 10
fi
"
compressing log with: /bin/gzip
removing old log /var/log/cups/error_log.8.gz
error: error opening /var/log/cups/error_log.8.gz: Aucun fichier ou dossier de ce type
rotating pattern: /var/log/dpkg.log monthly (12 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/dpkg.log
log does not need rotating
rotating pattern: /var/log/alternatives.log monthly (12 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/alternatives.log
log does not need rotating
rotating pattern: /var/log/exim4/mainlog /var/log/exim4/rejectlog after 1 days (10 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/exim4/mainlog
log needs rotating
considering log /var/log/exim4/rejectlog
log /var/log/exim4/rejectlog does not exist – skipping
rotating log /var/log/exim4/mainlog, log->rotateCount is 10
dateext suffix '-20131118’
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
compressing log with: /bin/gzip
renaming /var/log/exim4/mainlog.10.gz to /var/log/exim4/mainlog.11.gz (rotatecount 10, logstart 1, i 10),
renaming /var/log/exim4/mainlog.9.gz to /var/log/exim4/mainlog.10.gz (rotatecount 10, logstart 1, i 9),
renaming /var/log/exim4/mainlog.8.gz to /var/log/exim4/mainlog.9.gz (rotatecount 10, logstart 1, i 8),
renaming /var/log/exim4/mainlog.7.gz to /var/log/exim4/mainlog.8.gz (rotatecount 10, logstart 1, i 7),
renaming /var/log/exim4/mainlog.6.gz to /var/log/exim4/mainlog.7.gz (rotatecount 10, logstart 1, i 6),
renaming /var/log/exim4/mainlog.5.gz to /var/log/exim4/mainlog.6.gz (rotatecount 10, logstart 1, i 5),
renaming /var/log/exim4/mainlog.4.gz to /var/log/exim4/mainlog.5.gz (rotatecount 10, logstart 1, i 4),
renaming /var/log/exim4/mainlog.3.gz to /var/log/exim4/mainlog.4.gz (rotatecount 10, logstart 1, i 3),
renaming /var/log/exim4/mainlog.2.gz to /var/log/exim4/mainlog.3.gz (rotatecount 10, logstart 1, i 2),
renaming /var/log/exim4/mainlog.1.gz to /var/log/exim4/mainlog.2.gz (rotatecount 10, logstart 1, i 1),
renaming /var/log/exim4/mainlog.0.gz to /var/log/exim4/mainlog.1.gz (rotatecount 10, logstart 1, i 0),
renaming /var/log/exim4/mainlog to /var/log/exim4/mainlog.1
creating new /var/log/exim4/mainlog mode = 0640 uid = 101 gid = 4
removing old log /var/log/exim4/mainlog.11.gz
error: error opening /var/log/exim4/mainlog.11.gz: Aucun fichier ou dossier de ce type
rotating pattern: /var/log/exim4/paniclog 10485760 bytes (10 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/exim4/paniclog
log /var/log/exim4/paniclog does not exist – skipping
rotating pattern: /var/log/pm-suspend.log /var/log/pm-powersave.log monthly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/pm-suspend.log
log /var/log/pm-suspend.log does not exist – skipping
considering log /var/log/pm-powersave.log
log does not need rotating
rotating pattern: /var/log/syslog
after 1 days (7 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/syslog
log needs rotating
rotating log /var/log/syslog, log->rotateCount is 7
dateext suffix '-20131118’
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
compressing log with: /bin/gzip
renaming /var/log/syslog.7.gz to /var/log/syslog.8.gz (rotatecount 7, logstart 1, i 7),
renaming /var/log/syslog.6.gz to /var/log/syslog.7.gz (rotatecount 7, logstart 1, i 6),
renaming /var/log/syslog.5.gz to /var/log/syslog.6.gz (rotatecount 7, logstart 1, i 5),
renaming /var/log/syslog.4.gz to /var/log/syslog.5.gz (rotatecount 7, logstart 1, i 4),
renaming /var/log/syslog.3.gz to /var/log/syslog.4.gz (rotatecount 7, logstart 1, i 3),
renaming /var/log/syslog.2.gz to /var/log/syslog.3.gz (rotatecount 7, logstart 1, i 2),
renaming /var/log/syslog.1.gz to /var/log/syslog.2.gz (rotatecount 7, logstart 1, i 1),
renaming /var/log/syslog.0.gz to /var/log/syslog.1.gz (rotatecount 7, logstart 1, i 0),
renaming /var/log/syslog to /var/log/syslog.1
creating new /var/log/syslog mode = 0644 uid = 0 gid = 4
running postrotate script
running script with arg /var/log/syslog: "
invoke-rc.d rsyslog rotate > /dev/null
"
removing old log /var/log/syslog.8.gz
error: error opening /var/log/syslog.8.gz: Aucun fichier ou dossier de ce type
rotating pattern: /var/log/mail.info
/var/log/mail.warn
/var/log/mail.err
/var/log/mail.log
/var/log/daemon.log
/var/log/kern.log
/var/log/auth.log
/var/log/user.log
/var/log/lpr.log
/var/log/cron.log
/var/log/debug
/var/log/messages
weekly (4 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/mail.info
log does not need rotating
considering log /var/log/mail.warn
log does not need rotating
considering log /var/log/mail.err
log does not need rotating
considering log /var/log/mail.log
log does not need rotating
considering log /var/log/daemon.log
log does not need rotating
considering log /var/log/kern.log
log does not need rotating
considering log /var/log/auth.log
log does not need rotating
considering log /var/log/user.log
log does not need rotating
considering log /var/log/lpr.log
log does not need rotating
considering log /var/log/cron.log
log /var/log/cron.log does not exist – skipping
considering log /var/log/debug
log does not need rotating
considering log /var/log/messages
log does not need rotating
not running postrotate script, since no logs were rotated
rotating pattern: /var/log/wtmp monthly (1 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/wtmp
log does not need rotating
rotating pattern: /var/log/btmp monthly (1 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/btmp
log does not need rotating
[/code]
où on voit par exemple qu’il y a pas mal de log qui “needs rotating”.
Je passe surement à coté d’un truc, mais quoi?