Bug 54338 - UDM REST API logging broken after logrotation
UDM REST API logging broken after logrotation
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UDM - REST API
UCS 4.4
Other Linux
: P5 normal (vote)
: UCS 5.0-6-errata
Assigned To: Florian Best
Marius Meschter
https://git.knut.univention.de/univen...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2022-01-14 13:40 CET by Dirk Ahrnke
Modified: 2024-01-14 09:50 CET (History)
6 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 5: Will affect all installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.171
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional): Regression
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dirk Ahrnke univentionstaff 2022-01-14 13:40:33 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.
Comment 1 Florian Best univentionstaff 2022-01-14 13:46:56 CET
a kill via SIGHUP (1) needs to be done to main process.

The logrotation script needs to add:
lastaction
   # kill script...
endscript
Comment 4 Florian Best univentionstaff 2024-01-03 15:45:11 CET
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
Comment 5 Marius Meschter univentionstaff 2024-01-04 09:23:49 CET
QA:
   YAML/Changelog: OK
   logging works after log rotate: OK
   the systemd service file has been adjusted: OK