Royce Lv has uploaded a new change for review.
Change subject: [WIP]normalize startup:export priviledged launch for starting supervdsm ......................................................................
[WIP]normalize startup:export priviledged launch for starting supervdsm
Supervdsm will be started by priviledged process when vdsm init. export the launch function to privilidged user, eliminate vdsm from starting svdsm.
Change-Id: I4a96267e6473b7dcfbe4367a215697c8a4cb8ff5 Signed-off-by: Royce Lvlvroyce@linux.vnet.ibm.com --- M vdsm/supervdsm.py 1 file changed, 11 insertions(+), 2 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/06/10706/1
diff --git a/vdsm/supervdsm.py b/vdsm/supervdsm.py index 782b183..3540793 100644 --- a/vdsm/supervdsm.py +++ b/vdsm/supervdsm.py @@ -51,6 +51,12 @@ extraPythonPathList = []
+def restartSuperVdsm(): + proxy = getProxy() + proxy.kill() + proxy.launch() + + class _SuperVdsmManager(BaseManager): pass
@@ -93,8 +99,7 @@ # uses. We need to be able to change these variables so that running # tests doesn't disturb and already running VDSM on the host. self.setIPCPaths(PIDFILE, TIMESTAMP, ADDRESS) - self.kill() - self.launch() + self._svdsm = None
def setIPCPaths(self, pidfile, timestamp, address): self.pidfile = pidfile @@ -126,6 +131,8 @@ sleep(2)
def kill(self): + if os.geteuid() != 0: + raise OSError try: if self._isSvdsmAlive(): with open(self.pidfile, "r") as f: @@ -188,6 +195,8 @@ self._svdsm = self._manager.instance()
def launch(self): + if os.geteuid() != 0: + raise OSError self._start() utils.retry(self._connect, Exception, timeout=60)
-- To view, visit http://gerrit.ovirt.org/10706 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: I4a96267e6473b7dcfbe4367a215697c8a4cb8ff5 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Royce Lv lvroyce@linux.vnet.ibm.com
oVirt Jenkins CI Server has posted comments on this change.
Change subject: [WIP]normalize startup:export priviledged launch for starting supervdsm ......................................................................
Patch Set 1:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/583/ (1/2)
-- To view, visit http://gerrit.ovirt.org/10706 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I4a96267e6473b7dcfbe4367a215697c8a4cb8ff5 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: [WIP]normalize startup:export priviledged launch for starting supervdsm ......................................................................
Patch Set 1:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/618/ (2/2)
-- To view, visit http://gerrit.ovirt.org/10706 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I4a96267e6473b7dcfbe4367a215697c8a4cb8ff5 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: [WIP]normalize startup:export priviledged launch for starting supervdsm ......................................................................
Patch Set 1: Fails
Build Failed
http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/618/ : FAILURE
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/583/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/10706 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I4a96267e6473b7dcfbe4367a215697c8a4cb8ff5 Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: [WIP]normalize startup:export priviledged launch for starting supervdsm ......................................................................
Patch Set 2:
Build Started http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/629/ (1/2)
-- To view, visit http://gerrit.ovirt.org/10706 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I4a96267e6473b7dcfbe4367a215697c8a4cb8ff5 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: [WIP]normalize startup:export priviledged launch for starting supervdsm ......................................................................
Patch Set 2:
Build Started http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/594/ (2/2)
-- To view, visit http://gerrit.ovirt.org/10706 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I4a96267e6473b7dcfbe4367a215697c8a4cb8ff5 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
oVirt Jenkins CI Server has posted comments on this change.
Change subject: [WIP]normalize startup:export priviledged launch for starting supervdsm ......................................................................
Patch Set 2:
Build Successful
http://jenkins.ovirt.org/job/vdsm_unit_tests_manual_gerrit/629/ : SUCCESS
http://jenkins.ovirt.org/job/vdsm_pep8_gerrit/594/ : SUCCESS
-- To view, visit http://gerrit.ovirt.org/10706 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I4a96267e6473b7dcfbe4367a215697c8a4cb8ff5 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: oVirt Jenkins CI Server
Yaniv Bronhaim has posted comments on this change.
Change subject: [WIP]normalize startup:export priviledged launch for starting supervdsm ......................................................................
Patch Set 2: (2 inline comments)
so only svdsm can kill itself? when we'll run svdsm as a deamon it can work.. but now, if svdsm kills itself, how it supposed to launch again? you want to keep svdsm init process alive?
.................................................... File vdsm/supervdsm.py Line 98: # Declaration of public variables that keep files' names that svdsm Line 99: # uses. We need to be able to change these variables so that running Line 100: # tests doesn't disturb and already running VDSM on the host. Line 101: self.setIPCPaths(PIDFILE, TIMESTAMP, ADDRESS) Line 102: self._svdsm = None if you omit the restart here why do you base your patch over it (gerrit.ovirt.org/#/c/9691) Line 103: Line 104: def setIPCPaths(self, pidfile, timestamp, address): Line 105: self.pidfile = pidfile Line 106: self.timestamp = timestamp
Line 136: try: Line 137: if self._isSvdsmAlive(): Line 138: with open(self.pidfile, "r") as f: Line 139: pid = int(f.read().strip()) Line 140: misc.execCmd([constants.EXT_KILL, "-9", str(pid)], sudo=True) if we run as root we don't need to run this command with sudo=True, and we can use os.kill Line 141: except Exception: Line 142: self._log.warn("Could not kill old Super Vdsm %s", Line 143: exc_info=True) Line 144:
-- To view, visit http://gerrit.ovirt.org/10706 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I4a96267e6473b7dcfbe4367a215697c8a4cb8ff5 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Royce Lv has posted comments on this change.
Change subject: [WIP]normalize startup:export priviledged launch for starting supervdsm ......................................................................
Patch Set 2:
In module "vdsm", vdsm will kill and start svdsm ,then drop priviledge.
-- To view, visit http://gerrit.ovirt.org/10706 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: I4a96267e6473b7dcfbe4367a215697c8a4cb8ff5 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
Royce Lv has abandoned this change.
Change subject: [WIP]normalize startup:export priviledged launch for starting supervdsm ......................................................................
Patch Set 2: Abandoned
-- To view, visit http://gerrit.ovirt.org/10706 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: abandon Gerrit-Change-Id: I4a96267e6473b7dcfbe4367a215697c8a4cb8ff5 Gerrit-PatchSet: 2 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Royce Lv lvroyce@linux.vnet.ibm.com Gerrit-Reviewer: Yaniv Bronhaim ybronhei@redhat.com Gerrit-Reviewer: oVirt Jenkins CI Server
vdsm-patches@lists.fedorahosted.org