Change in vdsm[master]: [WIP]normalize startup:export priviledged launch for startin...

lvroyce at linux.vnet.ibm.com lvroyce at linux.vnet.ibm.com
Mon Jan 7 09:57:16 UTC 2013


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 Lv<lvroyce at 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 at linux.vnet.ibm.com>


More information about the vdsm-patches mailing list