updates: call 'yum clean expire-cache' as root (#843)
In Fedora 20 sudo cannot be called from qrexec call (no tty available), so run it in separate call as root. Also add "-P" option to qubes-update-check call: for SysV systems it should be ignored and service started as normal user (which is just fine), but on systemd systems, the call would be redirected to systemctl, which refuse normal user service actions. "-P" flag acquires root privileges using PolicyKit.
This commit is contained in:
parent
4d54815ce3
commit
f096f0050a
@ -1219,8 +1219,15 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
|
||||
if vm.qid == 0:
|
||||
subprocess.check_call (["/usr/bin/qubes-dom0-update", "--clean", "--gui"])
|
||||
else:
|
||||
vm.run("sudo yum clean expire-cache;gpk-update-viewer;sudo service qubes-update-check start", verbose=False, autostart=True,
|
||||
notify_function=lambda lvl, msg: trayIcon.showMessage(msg, msecs=3000) )
|
||||
vm_run_common_args = {
|
||||
'verbose': False,
|
||||
'autostart': True,
|
||||
'notify_function': lambda lvl, msg: trayIcon\
|
||||
.showMessage(msg, msecs=3000) }
|
||||
vm.run("yum clean expire-cache", user='root', wait=True,
|
||||
**vm_run_common_args)
|
||||
vm.run("gpk-update-viewer;service qubes-update-check start -P",
|
||||
**vm_run_common_args)
|
||||
except Exception as ex:
|
||||
thread_monitor.set_error_msg(str(ex))
|
||||
thread_monitor.set_finished()
|
||||
|
Loading…
Reference in New Issue
Block a user