Merge "Check libvirtd based on /proc instead of /var/run"
This commit is contained in:
commit
4379e5aadc
@ -18,11 +18,9 @@ limitations under the License.
|
|||||||
|
|
||||||
set -ex
|
set -ex
|
||||||
|
|
||||||
if [[ -f /var/run/libvirtd.pid ]]; then
|
if [ -n "$(cat /proc/*/comm 2>/dev/null | grep libvirtd)" ]; then
|
||||||
LIBVIRTD_PID="$(< /var/run/libvirtd.pid)"
|
echo "ERROR: libvirtd daemon already running on host" 1>&2
|
||||||
test -d "/proc/$LIBVIRTD_PID" && \
|
exit 1
|
||||||
test 'libvirtd' = "$(< /proc/$LIBVIRTD_PID/comm)" && \
|
|
||||||
( echo "ERROR: Libvirtd daemon is already running" && exit 1 )
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -f /var/run/libvirtd.pid
|
rm -f /var/run/libvirtd.pid
|
||||||
|
Loading…
x
Reference in New Issue
Block a user