Merge branch 'always-stubdom-guid'
This commit is contained in:
commit
28886390b4
@ -352,25 +352,28 @@ class QubesHVm(QubesResizableVm):
|
|||||||
if (retcode != 0) :
|
if (retcode != 0) :
|
||||||
raise QubesException("Cannot start qubes-guid!")
|
raise QubesException("Cannot start qubes-guid!")
|
||||||
|
|
||||||
def start_guid(self, verbose = True, notify_function = None,
|
def start_guid(self, verbose=True, notify_function=None,
|
||||||
before_qrexec=False, **kwargs):
|
before_qrexec=False, **kwargs):
|
||||||
# If user force the guiagent, start_guid will mimic a standard QubesVM
|
if not before_qrexec:
|
||||||
if not before_qrexec and self.guiagent_installed:
|
return
|
||||||
kwargs['extra_guid_args'] = kwargs.get('extra_guid_args', []) + \
|
|
||||||
['-Q']
|
if not self.guiagent_installed or self.debug:
|
||||||
super(QubesHVm, self).start_guid(verbose, notify_function, **kwargs)
|
|
||||||
stubdom_guid_pidfile = '/var/run/qubes/guid-running.%d' % self.stubdom_xid
|
|
||||||
if os.path.exists(stubdom_guid_pidfile) and not self.debug:
|
|
||||||
try:
|
|
||||||
stubdom_guid_pid = int(open(stubdom_guid_pidfile, 'r').read())
|
|
||||||
os.kill(stubdom_guid_pid, signal.SIGTERM)
|
|
||||||
except Exception as ex:
|
|
||||||
print >> sys.stderr, "WARNING: Failed to kill stubdom gui daemon: %s" % str(ex)
|
|
||||||
elif before_qrexec and (not self.guiagent_installed or self.debug):
|
|
||||||
if verbose:
|
if verbose:
|
||||||
print >> sys.stderr, "--> Starting Qubes GUId (full screen)..."
|
print >> sys.stderr, "--> Starting Qubes GUId (full screen)..."
|
||||||
self.start_stubdom_guid(verbose=verbose)
|
self.start_stubdom_guid(verbose=verbose)
|
||||||
|
|
||||||
|
kwargs['extra_guid_args'] = kwargs.get('extra_guid_args', []) + \
|
||||||
|
['-Q', '-n']
|
||||||
|
|
||||||
|
stubdom_guid_pidfile = \
|
||||||
|
'/var/run/qubes/guid-running.%d' % self.stubdom_xid
|
||||||
|
if not self.debug and os.path.exists(stubdom_guid_pidfile):
|
||||||
|
# Terminate stubdom guid once "real" gui agent connects
|
||||||
|
stubdom_guid_pid = int(open(stubdom_guid_pidfile, 'r').read())
|
||||||
|
kwargs['extra_guid_args'] += ['-K', str(stubdom_guid_pid)]
|
||||||
|
|
||||||
|
super(QubesHVm, self).start_guid(verbose, notify_function, **kwargs)
|
||||||
|
|
||||||
def start_qrexec_daemon(self, **kwargs):
|
def start_qrexec_daemon(self, **kwargs):
|
||||||
if not self.qrexec_installed:
|
if not self.qrexec_installed:
|
||||||
if kwargs.get('verbose', False):
|
if kwargs.get('verbose', False):
|
||||||
|
Loading…
Reference in New Issue
Block a user