Fixed
Created: Nov 21, 2019
Updated: Jan 21, 2020
Resolved Date: Jan 21, 2020
Previous ID: OVP8-499
Found In Version: 9.0.0.23
Fix Version: 9.0.0.25
Severity: Standard
Applicable for: Wind River Linux 8
Component/s: Userspace
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.
# 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.