Merge "Kill libvirtd proc if any before start libvertd"
This commit is contained in:
commit
56a743e061
@ -18,9 +18,19 @@ limitations under the License.
|
|||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
if [ -n "$(cat /proc/*/comm 2>/dev/null | grep libvirtd)" ]; then
|
if [ -n "$(cat /proc/*/comm 2>/dev/null | grep -w libvirtd)" ]; then
|
||||||
echo "ERROR: libvirtd daemon already running on host" 1>&2
|
set +x
|
||||||
exit 1
|
for proc in $(ls /proc/*/comm 2>/dev/null); do
|
||||||
|
if [ "x$(cat $proc 2>/dev/null | grep -w libvirtd)" == "xlibvirtd" ]; then
|
||||||
|
set -x
|
||||||
|
libvirtpid=$(echo $proc | cut -f 3 -d '/')
|
||||||
|
echo "WARNING: libvirtd daemon already running on host" 1>&2
|
||||||
|
echo "$(cat "/proc/${libvirtpid}/status" 2>/dev/null | grep State)" 1>&2
|
||||||
|
kill -9 "$libvirtpid" || true
|
||||||
|
set +x
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
set -x
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f /var/run/libvirtd.pid
|
rm -f /var/run/libvirtd.pid
|
||||||
|
Loading…
Reference in New Issue
Block a user