Starting with Ubuntu 16.10, libvirtd is available, so use it
to keep the same standard across all distributions.
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
---
Makefile.am | 2 +-
contrib/kimchid.service.debian | 8 ++++++++
contrib/kimchid.service.ubuntu | 8 --------
utils.py | 8 +-------
4 files changed, 10 insertions(+), 16 deletions(-)
create mode 100644 contrib/kimchid.service.debian
delete mode 100644 contrib/kimchid.service.ubuntu
diff --git a/Makefile.am b/Makefile.am
index 36607a1..3cbc689 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -158,7 +158,7 @@ install-data-local:
@if test -d "$(systemdsystemunitdir)" ; then \
mkdir -p $(DESTDIR)/etc/systemd/system/wok.service.d; \
if test -f /etc/debian_version; then \
- $(INSTALL_DATA) contrib/kimchid.service.ubuntu
$(DESTDIR)/etc/systemd/system/wok.service.d/kimchi.conf; \
+ $(INSTALL_DATA) contrib/kimchid.service.debian
$(DESTDIR)/etc/systemd/system/wok.service.d/kimchi.conf; \
else \
$(INSTALL_DATA) contrib/kimchid.service.fedora
$(DESTDIR)/etc/systemd/system/wok.service.d/kimchi.conf; \
fi; \
diff --git a/contrib/kimchid.service.debian b/contrib/kimchid.service.debian
new file mode 100644
index 0000000..fc58f6a
--- /dev/null
+++ b/contrib/kimchid.service.debian
@@ -0,0 +1,8 @@
+[Unit]
+Requires=wok.service
+Wants=libvirtd.service
+After=libvirtd.service wok.service
+
+[Service]
+Nice=0
+PrivateTmp=no
diff --git a/contrib/kimchid.service.ubuntu b/contrib/kimchid.service.ubuntu
deleted file mode 100644
index e261942..0000000
--- a/contrib/kimchid.service.ubuntu
+++ /dev/null
@@ -1,8 +0,0 @@
-[Unit]
-Requires=wok.service
-Wants=libvirt-bin.service
-After=libvirt-bin.service wok.service
-
-[Service]
-Nice=0
-PrivateTmp=no
diff --git a/utils.py b/utils.py
index 26d3cf6..1e2c951 100644
--- a/utils.py
+++ b/utils.py
@@ -20,7 +20,6 @@
import contextlib
import json
-import platform
import re
import sqlite3
import time
@@ -264,11 +263,6 @@ def is_libvirtd_up():
"""
Checks if libvirtd.service is up.
"""
- distro, _, _ = platform.linux_distribution()
- if distro.lower() == 'ubuntu':
- cmd = ['systemctl', 'is-active', 'libvirt-bin.service']
- else:
- cmd = ['systemctl', 'is-active', 'libvirtd.service']
-
+ cmd = ['systemctl', 'is-active', 'libvirtd.service']
output, error, rc = run_command(cmd, silent=True)
return True if output == 'active\n' else False
--
2.7.4