Werk #4499

ComponentAgent Bakery
TitleAgent Updater: Prevent broken state files caused by incomplete writes
Date2017-03-15 09:40:47
Check_MK EditionCheck_MK Enterprise Edition (CEE)
Check_MK Version1.4.0b4,1.5.0i1,1.2.8p19
Level1 - Trivial Change
ClassBug Fix
CompatibilityCompatible - no manual interaction needed

When the agent updater is being executed it writes it's current deployment state to a state file. When the system is turned of suddenly it could cause a file corruption of the cmk-update-agent.state file. We prevent this now by writing to a temporary file first, flush it and then move it over to the state file path.