Comment 18 for bug 510658

Revision history for this message
Dustin Kirkland  (kirkland) wrote : Re: [Bug 510658] Re: error : qemudWritePidFile:498 : Failed to open pid file '/var/run/libvirtd.pid' : File exists

Thanks for the research, Loic.

The logic is perfectly sound, to me.

I wholeheartedly agree that the upstream daemon (or whatever creates
the bloody pid file) should clean up the damn thing. But as you said,
for Lucid, we probably shouldn't go mucking about in the daemon's
internals.

What we could do is replicate that logic in the upstart job.

if [ -f /var/run/libvirtd.pid ]; then
  if ps $(cat /var/run/libvirtd.pid) | grep -qs /usr/sbin/libvirtd; then
    echo "libvirtd is already running, process " $(cat /var/run/libvirtd.pid)
  else
    echo "libvirtd is not running, but its pidfile exists...removing
that now..."
    rm -f /var/run/libvirtd.pid
  fi
fi

Loic- would something like this in the upstart job for Lucid make you happier?