Restart manager after installing update

This commit is contained in:
Agnieszka Kostrzewa 2012-05-15 09:11:25 +02:00
parent b116ce96f8
commit a974f10435
2 changed files with 9 additions and 1 deletions

View File

@ -22,6 +22,7 @@
import sys
import os
import signal
import fcntl
import errno
import dbus
@ -1825,6 +1826,8 @@ def handle_exception( exc_type, exc_value, exc_traceback ):
msg_box.exec_()
def sighup_handler(signum, frame):
os.execl("/usr/bin/qubes-manager")
def main():
@ -1832,7 +1835,9 @@ def main():
# Avoid starting more than one instance of the app
lock = QubesDaemonPidfile ("qubes-manager")
if lock.pidfile_exists():
if lock.pidfile_is_stale():
if lock.read_pid() == os.getpid():
pass
elif lock.pidfile_is_stale():
lock.remove_pidfile()
print "Removed stale pidfile (has the previous daemon instance crashed?)."
else:
@ -1840,6 +1845,8 @@ def main():
lock.create_pidfile()
signal.signal(signal.SIGHUP, sighup_handler)
global qubes_host
qubes_host = QubesHost()

View File

@ -67,6 +67,7 @@ cp qubes-manager.desktop $RPM_BUILD_ROOT/etc/xdg/autostart/
%post
update-desktop-database &> /dev/null || :
killall -1 qubes-manager
%postun
update-desktop-database &> /dev/null || :