Werk #14958: cmk-update-agent: Fix lockfile handling

Component Agent bakery
Title cmk-update-agent: Fix lockfile handling
Date Nov 3, 2022
Checkmk Editon Checkmk Enterprise (CEE)
Checkmk Version 2.2.0i1 2.1.0p16 2.0.0p30
Level Trivial Change
Class Bug Fix
Compatibility Compatible - no manual interaction needed

This Werk mainly fixes an inconvenience that occured when invoking multiple instances of the Agent Updater simultaneously.

Since Werk #14732, it's possible for the Agent Updater to wait for running exclusively. However, before this Werk, a second instance failed to actually open and hold the respective lockfile (because the first instance deleted it). Hence, it also failed to delete it in the end.

This resulted in an error message like No such file or directory: '/tmp/cmk-update-agent.pid'". This didn't result in a crash, but the error was printed to the logfile and could lead to confusion.

To the list of all Werks