util: keep the pidfile locked
Unfortunately, advisory record locking lose the lock if any fd refering to the file is closed. There doesn't seem to be a way to preserve the lock atomically. We could eventually retake the lock if low pidfilefd is required. This fixes processes being leaked, as they are not killed in virPidFileForceCleanupPath() if the lock can be taken. Here also, we may consider this is not good enough, as a process may leak by simply closing the pidfilefd. Fixes commit d146105f ("virCommand: Actually acquire pidfile instead of just writing it") Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: NMichal Privoznik <mprivozn@redhat.com>
Showing
想要评论请 注册 或 登录