Werk #18917: Agent updater/non-root agent: Stops working after logfile rotation

Component Agent bakery
Title Agent updater/non-root agent: Stops working after logfile rotation
Date Oct 21, 2025
Level Trivial Change
Class Bug Fix
Compatibility Incompatible - Manual interaction might be required
Checkmk versions & editions
2.5.0b1
Not yet released
Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)
2.4.0p15
Not yet released
Checkmk Enterprise (CEE), Checkmk Cloud (CCE), Checkmk MSP (CME)

This is a follow-up to Werk #18278.

When using the agent updater together with the non-root agent deployment, agent updates stopped working on cmk-update-agent.log logfile rotation.

Technical background:
Additional to the PID-file - see Werk mentioned above - the two instances of cmk-update-agent also share the same logfile.
The logfile normally gets created by the agent updater running under the non-root user.
After a while the logfile gets rotated, i.e., cmk-update-agent.log is moved to cmk-update-agent.log.1 and a new cmk-update-agent.log is created.
This is normally done by the agent updater running under root, since it's invoked every minute.
However, the new logfile gets created with root ownership, and the non-root agent updater instance can't initialize logging, resulting in a crash.

To unblock agent installations to perform updates again, you can change the ownership of the logfile manually:

chown cmk-agent:cmk-agent /opt/checkmk/agent/default/runtime/cmk-update-agent.log

Please make sure to update the agent soon, since the error would come back after next logfile rotation.

To the list of all Werks