Dima Kuznetsov has uploaded a new change for review.
Change subject: tool: Remove upstart handling in libvirt configurator
......................................................................
tool: Remove upstart handling in libvirt configurator
libvirt configurator used to check if upstart is available and configure
libvirtd using initctl.
Since systemd is now the system manager on Debian Jessie, RHEL7 and
Ubuntu Vivid, we no longer have to support sysvinit/upstart.
Change-Id: Ic71430103cb04a5636b4b41371852cbf68495db7
Signed-off-by: Dima Kuznetsov <dkuznets(a)redhat.com>
---
M lib/vdsm/tool/configurators/libvirt.py
1 file changed, 0 insertions(+), 61 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/20/40420/1
diff --git a/lib/vdsm/tool/configurators/libvirt.py
b/lib/vdsm/tool/configurators/libvirt.py
index e182231..5b14cea 100644
--- a/lib/vdsm/tool/configurators/libvirt.py
+++ b/lib/vdsm/tool/configurators/libvirt.py
@@ -17,11 +17,8 @@
# Refer to the README and COPYING files for full details of the license
#
import errno
-import filecmp
import os
import uuid
-import rpm
-import shutil
import sys
from vdsm.config import config
@@ -39,7 +36,6 @@
ConfigFile,
ParserWrapper,
)
-from .. import service
from .. validate_ovirt_certs import validate_ovirt_certs
from ... import utils
from ... import constants
@@ -58,8 +54,6 @@
def configure():
- _sysvToUpstart()
-
if utils.isOvirtNode():
if not os.path.exists(constants.P_VDSM_CERT):
raise InvalidRun(
@@ -117,61 +111,6 @@
cfile['path'] for cfile in FILES.values()
if cfile['persisted']
]
-
-
-def _sysvToUpstart():
- """
- On RHEL 6, libvirtd can be started by either SysV init or Upstart.
- We prefer upstart because it respawns libvirtd if libvirtd
- crashed.
- """
- def iterateLibvirtFiles():
- ts = rpm.TransactionSet()
- for name in ['libvirt', 'libvirt-daemon']:
- for matches in ts.dbMatch('name', name):
- for filename in matches[rpm.RPMTAG_FILENAMES]:
- yield filename
-
- def reloadConfiguration():
- rc, out, err = utils.execCmd((INITCTL,
- "reload-configuration"))
- if rc != 0:
- sys.stdout.write(out)
- sys.stderr.write(err)
- raise InvalidRun(
- "Failed to reload upstart configuration.")
-
- INITCTL = '/sbin/initctl'
- LIBVIRTD_UPSTART = 'libvirtd.upstart'
- TARGET = os.path.join(constants.SYSCONF_PATH, "init/libvirtd.conf")
-
- if os.path.isfile(INITCTL) and os.access(INITCTL, os.X_OK):
- # libvirtd package does not provide libvirtd.upstart,
- # this could happen in Ubuntu or other distro,
- # so continue to use system default init mechanism
- packaged = ''
- for fname in iterateLibvirtFiles():
- if os.path.basename(fname) == LIBVIRTD_UPSTART:
- packaged = fname
- break
-
- if os.path.isfile(packaged):
- if not os.path.isfile(TARGET):
- service.service_stop('libvirtd')
- if (not os.path.isfile(TARGET) or
- not filecmp.cmp(packaged, TARGET)):
- oldmod = None
- if os.path.isfile(TARGET):
- oldmod = os.stat(TARGET).st_mode
-
- utils.unpersist(TARGET)
- shutil.copyfile(packaged, TARGET)
- utils.persist(TARGET)
-
- if (oldmod is not None and
- oldmod != os.stat(TARGET).st_mode):
- os.chmod(TARGET, oldmod)
- reloadConfiguration()
def _isSslConflict():
--
To view, visit
https://gerrit.ovirt.org/40420
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic71430103cb04a5636b4b41371852cbf68495db7
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dima Kuznetsov <dkuznets(a)redhat.com>