/etc/init.d/libvirt-bin does not check that libvirtd has terminated on stop

Bug #522688 reported by Chris Bainbridge on 2010-02-16
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
libvirt (Ubuntu)
Low
Unassigned

Bug Description

The script does: start-stop-daemon --stop --pidfile /var/run/libvirtd.pid --exec '/usr/sbin/libvirtd'
It should do something like: start-stop-daemon --stop --pidfile /var/run/libvirtd.pid --exec '/usr/sbin/libvirtd' --retry 5

--retry means libvirtd will be sent SIGKILL if it does not shutdown from the default signal (--retry is in common use in Ubuntu scripts, see 'grep retry /etc/init.d/*')

Dustin Kirkland  (kirkland) wrote :

Thanks for the report.

Can you reproduce this in Lucid?

I've recently ported libvirt to use upstart for init. I'd be curious if you can reproduce this problem there.

Thanks.

Changed in libvirt (Ubuntu):
status: New → Incomplete

Yes.

Do "virsh save dom /tmp/x" to hang libvirtd (bug #457716)
Then "service libvirt-bin restart" to restart libvirtd. It reports that the service is running but this is not true - in fact the process has died without reporting an error.
If I then run libvirtd manually I get:

# libvirtd
10:51:36.935: error : qemudWritePidFile:494 : Failed to open pid file '/var/run/libvirtd.pid' : File exists

The return code of the libvirtd process is 1 - a failure - so the init script should report fail but it does not.

Also /var/run/libvirtd.pid should be removed when the libvirtd process isn't running anymore and before attempting to start libvirtd.

Changed in libvirt (Ubuntu):
status: Incomplete → Confirmed
Changed in libvirt (Ubuntu):
importance: Undecided → Low
Serge Hallyn (serge-hallyn) wrote :

Tried the test case in comment #2 on oneiric, and failed to reproduce. 'Restart libvirt-bin' gives

restart: Unknown instance:

and start libvirt-bin works.

Marking this fix released. If anyone sees this on, for instance, lucid, please feel free to mark as affecting lucid or comment here.

Changed in libvirt (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers