現象
Upgrade von 19.1 auf 19.2
– Nach dem Upgrade von Avamar
19.1 auf 19.2 erscheinen Protokollrotationsfehler in /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'.
– Nach Durchsicht von /var/log/messages werden diese Fehler ausgelöst, wenn die Datei: /etc/init.d/apache2 nicht gefunden werden konnte, um die Vorabrotation in logrotate.d für Apache2 durchzuführen.
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 Server führt 19.2 mit SLES 12 SP 4 aus:
admin@avamar:~/>: cat /etc/*release* SUSE Linux Enterprise Server 12 (x86_64) VERSION = 12 PATCHLEVEL = 4 # This file is deprecated and will be removed in a future service pack or release. # Please check /etc/os-release for details about this 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“
– Manuelle Ausführung des Befehls, um das Verzeichnis zu überprüfen: /etc/init.d/apache2 schlägt mit „No such file or directory“ fehl.
admin@avamar:~/>: ls -ltrh /etc/init.d/apache2 ls: cannot access '/etc/init.d/apache2': No such file or directory
原因
Ein Softwarefehler hat dazu geführt, dass die Protokollrotation für Apache2 init.d-Dateien überprüft, die in SLES 12 nicht vorhanden sind.
In SLES 11 wurde der init.d-Service verwendet, in SLES 12 wird jedoch der systemctl-Service verwendet.
解決方法
Problemumgehung:
1. Melden Sie sich beim Utility-Node oder Einzel-Node-System als Administratornutzer an und werden Sie root-Nutzer.
2. Verschieben Sie die vorhandene Protokollrotationsdatei an einen anderen Ort.
mv /etc/logrotate.d/apache2 /tmp
3. Erstellen Sie die Datei mit vi neu.
vi /etc/logrotate.d/apache2
4. Kopieren Sie die folgenden Zeilen in einen Texteditor, z. B. Notepad oder Notepad++ (verwenden Sie nicht Word oder Wordpad, da dadurch die Sonderzeichen eingeführt werden)
/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. Fügen Sie den Text aus dem Editor in eine neu erstellte Datei auf einem Avamar Node ein.
6. Speichern Sie die Änderungen.
7. Richten Sie die korrekten Berechtigungen für die Datei ein.
chmod 644 /etc/logrotate.d/apache2
8. Testen Sie die Protokollrotation als root-Nutzer.
logrotate -f /etc/logrotate.conf
Dauerhafte Lösung: Das Problem wird in der nächsten Avamar Version: 19.3 behoben.
対象製品
Avamar
製品
Avamar, Avamar Server