Browse Source

core/HVM: always start qrexec daemon

If not marked as installed, start it in background - waiting for
possible Qubes Tools installation. If that happens, make it possible to
tell the dom0 about that fact.
Marek Marczykowski-Górecki 10 years ago
parent
commit
495a24a2e7
1 changed files with 11 additions and 1 deletions
  1. 11 1
      core-modules/01QubesHVm.py

+ 11 - 1
core-modules/01QubesHVm.py

@@ -261,7 +261,17 @@ class QubesHVm(QubesVm):
                 raise QubesException("Cannot start qubes-guid!")
 
     def start_qrexec_daemon(self, **kwargs):
-        if self.qrexec_installed:
+        if not self.qrexec_installed:
+            if kwargs.get('verbose', False):
+                print >> sys.stderr, "--> Starting the qrexec daemon..."
+            xid = self.get_xid()
+            qrexec_env = os.environ
+            qrexec_env['QREXEC_STARTUP_NOWAIT'] = '1'
+            retcode = subprocess.call ([system_path["qrexec_daemon_path"], str(xid), self.name, self.default_user], env=qrexec_env)
+            if (retcode != 0) :
+                self.force_shutdown(xid=xid)
+                raise OSError ("ERROR: Cannot execute qrexec-daemon!")
+        else:
             super(QubesHVm, self).start_qrexec_daemon(**kwargs)
 
             if self._start_guid_first: