現象
Aktualizacja z wersji 19.1 do 19.2
— po aktualizacji z wersji Avamar
19.1 do wersji 19.2 w pliku /var/log/messages są wyświetlane błędy logrotate.
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'.
— Odczyt (/var/log/messages), błędy te są wyzwalane, gdy nie znajdzie pliku: /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'.
— Serwer Avamar w wersji 19.2, z SLES 12 SP 4:
admin@avamar:~/>: cat /etc/*release* SUSE Linux Enterprise Server 12 (x86_64) VERSION = 12 PATCHLEVEL = 4 # Ten plik został wycofany i zostanie usunięty w przyszłym dodatku Service Pack lub wersji. # Szczegółowe informacje na temat tej wersji można znaleźć w pliku /etc/os-release. 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"
— ręczne uruchamianie polecenia w celu sprawdzenia katalogu: /etc/init.d/apache2 kończy się niepowodzeniem z komunikatem „No such file or directory”.
admin@avamar:~/>: ls -ltrh /etc/init.d/apache2 ls: cannot access '/etc/init.d/apache2': No such file or directory
原因
Błąd oprogramowania, który spowodował, że apache2 sprawdzał pliki init.d, które nie istnieją w systemie SLES 12.
W systemie SLES 11 używana była usługa init.d, ale w systemie SLES 12 używana jest usługa systemctl.
解決方法
Obejście problemu:
1. Zaloguj się do węzła narzędzia lub systemu z jednym węzłem jako administrator i przejdź na główny.
2. Przenieś istniejący plik logrotate
mv /etc/logrotate.d/apache2 /tmp
3. Odtwórz plik za pomocą vi
vi /etc/logrotate.d/apache2
4. Skopiuj następujące wiersze do edytora tekstu, takiego jak Notatnik lub Notepad++ (nie używaj Word ani WordPad, ponieważ wproawdzają one znaki specjalne)
/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. Wklej tekst z edytora do nowo utworzonego pliku w węźle Avamar
6. Zapisz zmiany
7. Ustaw odpowiednie uprawnienia dostępu do pliku
chmod 644 /etc/logrotate.d/apache2
8. Przetestuj rotację dziennika jako katalog główny.
logrotate -f /etc/logrotate.conf
Trwałe rozwiązanie: Problem zostanie rozwiązany w następnej wersji Avamar: 19.3.
対象製品
Avamar
製品
Avamar, Avamar Server