Restart manager after installing update
This commit is contained in:
parent
b116ce96f8
commit
a974f10435
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
import signal
|
||||||
import fcntl
|
import fcntl
|
||||||
import errno
|
import errno
|
||||||
import dbus
|
import dbus
|
||||||
@ -1825,6 +1826,8 @@ def handle_exception( exc_type, exc_value, exc_traceback ):
|
|||||||
|
|
||||||
msg_box.exec_()
|
msg_box.exec_()
|
||||||
|
|
||||||
|
def sighup_handler(signum, frame):
|
||||||
|
os.execl("/usr/bin/qubes-manager")
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
@ -1832,7 +1835,9 @@ def main():
|
|||||||
# Avoid starting more than one instance of the app
|
# Avoid starting more than one instance of the app
|
||||||
lock = QubesDaemonPidfile ("qubes-manager")
|
lock = QubesDaemonPidfile ("qubes-manager")
|
||||||
if lock.pidfile_exists():
|
if lock.pidfile_exists():
|
||||||
if lock.pidfile_is_stale():
|
if lock.read_pid() == os.getpid():
|
||||||
|
pass
|
||||||
|
elif lock.pidfile_is_stale():
|
||||||
lock.remove_pidfile()
|
lock.remove_pidfile()
|
||||||
print "Removed stale pidfile (has the previous daemon instance crashed?)."
|
print "Removed stale pidfile (has the previous daemon instance crashed?)."
|
||||||
else:
|
else:
|
||||||
@ -1840,6 +1845,8 @@ def main():
|
|||||||
|
|
||||||
lock.create_pidfile()
|
lock.create_pidfile()
|
||||||
|
|
||||||
|
signal.signal(signal.SIGHUP, sighup_handler)
|
||||||
|
|
||||||
global qubes_host
|
global qubes_host
|
||||||
qubes_host = QubesHost()
|
qubes_host = QubesHost()
|
||||||
|
|
||||||
|
@ -67,6 +67,7 @@ cp qubes-manager.desktop $RPM_BUILD_ROOT/etc/xdg/autostart/
|
|||||||
|
|
||||||
%post
|
%post
|
||||||
update-desktop-database &> /dev/null || :
|
update-desktop-database &> /dev/null || :
|
||||||
|
killall -1 qubes-manager
|
||||||
|
|
||||||
%postun
|
%postun
|
||||||
update-desktop-database &> /dev/null || :
|
update-desktop-database &> /dev/null || :
|
||||||
|
Loading…
Reference in New Issue
Block a user