From 01b67a0af189b0ac035c447604ef1b794531997c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Wed, 23 Nov 2016 04:13:02 +0100 Subject: [PATCH] Handle both old and new shm.id path This ease transition (installing new package will not break system). --- core-modules/000QubesVm.py | 3 ++- core-modules/01QubesDisposableVm.py | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core-modules/000QubesVm.py b/core-modules/000QubesVm.py index 9a950710..45e9bade 100644 --- a/core-modules/000QubesVm.py +++ b/core-modules/000QubesVm.py @@ -2012,7 +2012,8 @@ class QubesVm(object): # Run GUI daemon in "invisible" mode, so applications started by # prerun script will not disturb the user extra_guid_args = ['-I'] - elif not os.path.exists('/var/run/qubes/shm.id'): + elif not os.path.exists('/var/run/qubes/shm.id') \ + and not os.path.exists('/var/run/shm.id'): # Start GUI daemon only when shmoverride is loaded; unless # preparing DispVM, where it isn't needed because of "invisible" # mode diff --git a/core-modules/01QubesDisposableVm.py b/core-modules/01QubesDisposableVm.py index 0e11aaa1..a0fe4e54 100644 --- a/core-modules/01QubesDisposableVm.py +++ b/core-modules/01QubesDisposableVm.py @@ -40,7 +40,7 @@ except ImportError: pass DISPID_STATE_FILE = '/var/run/qubes/dispid' -GUID_SHMID_FILE = '/var/run/qubes/shm.id' +GUID_SHMID_FILE = ['/var/run/qubes/shm.id', '/var/run/shm.id'] class QubesDisposableVm(QubesVm): """ @@ -223,7 +223,8 @@ class QubesDisposableVm(QubesVm): if qmemman_present: qmemman_client.close() - if kwargs.get('start_guid', True) and os.path.exists(GUID_SHMID_FILE): + if kwargs.get('start_guid', True) and \ + any(os.path.exists(x) for x in GUID_SHMID_FILE): self.start_guid(verbose=verbose, before_qrexec=True, notify_function=kwargs.get('notify_function', None)) @@ -231,7 +232,8 @@ class QubesDisposableVm(QubesVm): notify_function=kwargs.get('notify_function', None)) print >>sys.stderr, "time=%s, qrexec done" % (str(time.time())) - if kwargs.get('start_guid', True) and os.path.exists(GUID_SHMID_FILE): + if kwargs.get('start_guid', True) and \ + any(os.path.exists(x) for x in GUID_SHMID_FILE): self.start_guid(verbose=verbose, notify_function=kwargs.get('notify_function', None)) print >>sys.stderr, "time=%s, guid done" % (str(time.time()))