[Bug 510658] Re: error : qemudWritePidFile:498 : Failed to open pid file '/var/run/libvirtd.pid' : File exists

Arnd arnd at arndnet.de
Tue Feb 2 10:36:07 GMT 2010


After thinking some time about this, I'm not convinced anymore that
libvirtd itself should handle this.

If libvirtd is started and finds the stale pid file there. It could
check if the process with the pid contained in that file is running
anymore. But even if libvirtd crashed, in the meantime another process
could have got exactly the same pid.

Fortunately, upstart _knows_ that libvirtd just crashed and is not
longer running anymore, and can therefore safely remove the pidfile
(example below). What do you think about this?

E.g.:

  1 description "libvirt daemon"
  2 author "Dustin Kirkland <kirkland at canonical.com>"
  3 
  4 start on runlevel [2345]
  5 stop on runlevel [!2345]
  6 
  7 expect daemon
  8 respawn
  9 
 10 pre-start script
 11     mkdir -p /var/run/libvirt
 12     if [ -e /var/run/libvirtd.pid ]; then
 13         rm /var/run/libvirtd.pid
 14     fi
 15 end script
 16 
 17 # if you used to set $libvirtd_opts in /etc/default/libvirt-bin, you can change the
 18 # 'exec' line here instead
 19 exec /usr/sbin/libvirtd -d

-- 
error : qemudWritePidFile:498 : Failed to open pid file '/var/run/libvirtd.pid' : File exists
https://bugs.launchpad.net/bugs/510658
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to libvirt in ubuntu.



More information about the Ubuntu-server-bugs mailing list