Merge branch 'bug1241'

Fixes QubesOS/qubes-issues#1241
This commit is contained in:
Marek Marczykowski-Górecki 2015-10-02 01:59:17 +02:00
commit 4f04c62f36
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -34,6 +34,7 @@ import sys
import time
import uuid
import xml.parsers.expat
import signal
from qubes import qmemman
from qubes import qmemman_algo
import libvirt
@ -1717,6 +1718,18 @@ class QubesVm(object):
def start_qubesdb(self):
self.log.debug('start_qubesdb()')
pidfile = '/var/run/qubes/qubesdb.{}.pid'.format(self.name)
try:
if os.path.exists(pidfile):
old_qubesdb_pid = open(pidfile, 'r').read()
os.kill(int(old_qubesdb_pid), signal.SIGTERM)
timeout = 25
while os.path.exists(pidfile) and timeout:
time.sleep(0.2)
timeout -= 1
except IOError: # ENOENT (pidfile)
pass
retcode = subprocess.call ([
system_path["qubesdb_daemon_path"],
str(self.xid),