現象
Opgradering fra 19.1 til 19.2
- Efter opgradering fra Avamar
19.1 til 19.2 vises der logrotate-fejl i /var/log/messages.
admin@avamar:~/>: grep -i "logrotate.service" /var/log/messages Feb 1 00:00:01 avamar systemd[1]: logrotate.service: Main process exited, code=exited, status=1/FAILURE Feb 1 00:00:01 avamar systemd[1]: logrotate.service: Unit entered failed state. Feb 1 00:00:01 avamar systemd[1]: logrotate.service: Failed with result 'exit-code'. Feb 2 00:00:03 avamar systemd[1]: logrotate.service: Main process exited, code=exited, status=1/FAILURE Feb 2 00:00:03 avamar systemd[1]: logrotate.service: Unit entered failed state. Feb 2 00:00:03 avamar systemd[1]: logrotate.service: Failed with result 'exit-code'. Feb 3 00:00:01 avamar systemd[1]: logrotate.service: Main process exited, code=exited, status=1/FAILURE Feb 3 00:00:01 avamar systemd[1]: logrotate.service: Unit entered failed state. Feb 3 00:00:01 avamar systemd[1]: logrotate.service: Failed with result 'exit-code'.
- Ved gennemlæsning af (/var/log/messages) udløses disse fejl, når følgende fil ikke findes: /etc/init.d/apache2 to run prerotate in the logrotate.d for apache2
Feb 2 16:30:02 avamar logrotate: ALERT exited abnormally with [1] Feb 2 16:30:02 avamar logrotate: logrotate_script: line 1: /etc/init.d/apache2: No such file or directory Feb 2 16:30:02 avamar logrotate: error: error running non-shared prerotate script for /var/log/apache2/access_log of '/var/log/apache2/access_log ' Feb 2 16:30:02 avamar logrotate: logrotate_script: line 1: /etc/init.d/apache2: No such file or directory Feb 2 16:30:02 avamar logrotate: error: error running non-shared prerotate script for /var/log/apache2/ssl_request_log of '/var/log/apache2/ssl_request_log ' Feb 3 00:00:01 avamar logrotate[14221]: logrotate_script: line 1: /etc/init.d/apache2: No such file or directory Feb 3 00:00:01 avamar logrotate[14221]: error: error running non-shared prerotate script for /var/log/apache2/access_log of '/var/log/apache2/access_log ' Feb 3 00:00:01 avamar logrotate[14221]: logrotate_script: line 1: /etc/init.d/apache2: No such file or directory Feb 3 00:00:01 avamar logrotate[14221]: error: error running non-shared prerotate script for /var/log/apache2/ssl_request_log of '/var/log/apache2/ssl_request_log ' Feb 3 00:00:01 avamar systemd[1]: logrotate.service: Main process exited, code=exited, status=1/FAILURE Feb 3 00:00:01 avamar systemd[1]: logrotate.service: Unit entered failed state. Feb 3 00:00:01 avamar systemd[1]: logrotate.service: Failed with result 'exit-code'.
- Avamar-serveren kører 19.2 med SLES 12 SP 4:
admin@avamar:~/>: cat /etc/*release* SUSE Linux Enterprise Server 12 (x86_64) VERSION = 12 PATCHLEVEL = 4 # Denne fil er forældet og bliver fjernet i en fremtidig servicepakke eller udgivelse. # Kontrollér /etc/os-release for oplysninger om denne udgivelse. NAME="SLES" VERSION="12-SP4" VERSION_ID="12.4" PRETTY_NAME="SUSE Linux Enterprise Server 12 SP4" ID="sles" ANSI_COLOR="0;32" CPE_NAME="cpe:/o:suse:sles:12:sp4"
- Manuel kørsel af kommandoen for at kontrollere, om der findes en mappe: /etc/init.d/apache2 mislykkes med "No such file or directory" (Filen eller mappen findes ikke).
admin@avamar:~/>: ls -ltrh /etc/init.d/apache2 ls: cannot access '/etc/init.d/apache2': No such file or directory
原因
En softwarefejl, der fik logrotate til apache2 til at kontrollere init.d-filer, som ikke findes i SLES 12.
init.d-tjenesten blev brugt i SLES 11, men i SLES 12 bruges systemctl-tjenesten.
解決方法
Løsning:
1. Log på hjælpeprogramsnoden eller enkeltnodesystemet som administrator, og bliv rod.
2. Flyt den eksisterende logrotate-fil væk
mv /etc/logrotate.d/apache2 /tmp
3. Genopret filen vha. vi
vi /etc/logrotate.d/apache2
4. Kopiér de følgende linjer til et tekstredigeringsprogram som f.eks. Notepad eller Notepad++ (brug ikke Word eller Wordpad, da det vil indføre specialtegnene)
/var/log/apache2/access_log /var/log/apache2/ssl_request_log {
compress
dateext
maxage 365
rotate 99
size=+4096k
notifempty
missingok
create 640 wwwrun www
sharedscripts
postrotate
systemctl reload apache2.service
sleep 60
endscript
}
/var/log/apache2/error_log /var/log/apache2/suexec.log /var/log/apache2/ssl_engine_log /var/log/apache2/deflate.log {
compress
dateext
maxage 365
rotate 99
size=+1024k
notifempty
missingok
create 640 wwwrun www
sharedscripts
postrotate
systemctl reload apache2.service
sleep 60
endscript
}
5. Indsæt teksten fra tekstredigeringsprogrammet i en nyligt oprettet fil på en Avamar-node
6. Gem ændringerne
7. Angiv de korrekte tilladelser for filen
chmod 644 /etc/logrotate.d/apache2
8. Test log-rotationen som rod.
logrotate -f /etc/logrotate.conf
Permanent løsning: Problemet vil blive løst i næste Avamar-version: 19,3.
対象製品
Avamar
製品
Avamar, Avamar Server