Univention Bugzilla – Bug 54338
UDM REST API logging broken after logrotation
Last modified: 2024-01-14 09:50:12 CET
Bug 53986 introduced logrotation for directory-manager-rest.log which appears not to work as expected. root@dcm:/var/log/univention# ls -ltr directory-manager-rest.log* | tail -3 -rw-r----- 1 root adm 124 Jan 13 06:06 directory-manager-rest.log.2.gz -rw-r----- 1 root adm 125 Jan 14 06:06 directory-manager-rest.log.1.gz -rw-r----- 1 root adm 0 Jan 14 06:29 directory-manager-rest.log root@dcm:/var/log/univention# ps -ef | grep rest | grep -v grep root 700 1 0 06:05 ? 00:00:01 /usr/bin/python2.7 -m univention.admin.rest.server root 12123 700 0 06:06 ? 00:00:01 /usr/bin/python2.7 -m univention.admin.rest -s /var/run/univention-directory-manager-rest-de-de.socket -l de_DE run root 12124 700 0 06:06 ? 00:00:01 /usr/bin/python2.7 -m univention.admin.rest -s /var/run/univention-directory-manager-rest-en-us.socket -l en_US run root@dcm:/var/log/univention# lsof -p 700 | grep log python2.7 700 root 1w REG 253,0 158 554250 /var/log/univention/directory-manager-rest.log.1 (deleted) python2.7 700 root 2w REG 253,0 158 554250 /var/log/univention/directory-manager-rest.log.1 (deleted) python2.7 700 root 10w REG 253,0 7392 538284 /var/log/univention/ucs-school-validation.log Explanation: This system is automatically started at 06:05. Logrotation occurs at 6:25 with the "compress" option. As the UDM-API is not restarted it will still try to write to the old logfile which does not exist anymore after compression. (without compression I would expect that the log would still be written but in the old file). Observed in customer environment.
a kill via SIGHUP (1) needs to be done to main process. The logrotation script needs to add: lastaction # kill script... endscript
MR: https://git.knut.univention.de/univention/ucs/-/merge_requests/949
univention-directory-manager-rest.yaml 4bb5633e275c | fix(udm-rest-api): reload UDM REST API logfiles after logrotation univention-directory-manager-rest (10.0.7-3) 4bb5633e275c | fix(udm-rest-api): reload UDM REST API logfiles after logrotation
QA: YAML/Changelog: OK logging works after log rotate: OK the systemd service file has been adjusted: OK
https://errata.software-univention.de/#/?erratum=5.0x912