Wind River Support Network

HomeDefectsOVP8-489
Fixed

OVP8-489 : Libvirtd init script restart logic fails rarely causing libvirtd to not start correctly

Created: Jun 7, 2019    Updated: Dec 23, 2019
Resolved Date: Aug 13, 2019
Found In Version: 8.0.0.25
Fix Version: 8.0.0.31
Severity: Standard
Applicable for: Wind River Linux 8
Component/s: Userspace

Description

Reporting an issue related to the /etc/init.d/libvirtd shell script  defines restart as:

restart)

$0 stop

sleep 1

$0 start ;;

 

 
The check here to determine if the existing process is correctly/completely stopped(based on the cleanup of pid file) does not work properly under all cases. On multiple restart attempts, it is observed that on occasion pid file is cleaned up, but the process is not yet completely stopped and sockets are still in use, which causes the failure of libvirtd start.

I created a script to restart multiple times the libvirtd procedure by calling " /etc/init.d/libvirtd restart" and I was able to reproduce the issue. Please find attached the script the log of the test and the fix that I am proposing to avoid the issue, now I am not sure if we need to dig further on "start-stop-daemon" to see why, inside the init script, it lets rm command to run before it finishes.

 

Steps to Reproduce

# Create a WRL8 project:  configure—enable-board=intel-x86-64 —enable-rootfs=ovp-kvm+installer-support —enable-addons=wr-ovp —enable-jobs=30 —enable-parallel-pkgbuilds=30 —enable-reconfig —with-layer=wr-dpdk —enable-bootimage=hdd,tar.bz2 —with-bootimage-space=1024 —enable-checkout-all-layers=yes —enable-rm-oldimgs=yes —with-init=sysvinit —with-rcpl-version=0025
 # Create an image  and install it on a target.
 # Download the script restart_libvirtd.sh and copy it to the target.
 # Execute the file script: restart_libvirtd.sh  | tee restart.log.

This script restart 5000 times the libvirtd daemon, I always was able to reproduce the issue in those 5000 restarts. 
Live chat
Online