去除uu关机延时,开启动态配置
This commit is contained in:
parent
91d94945ca
commit
7e36680ab8
|
@ -822,13 +822,13 @@ def inhibit_sleep():
|
|||
from gi.repository import Gio, GLib
|
||||
connection = Gio.bus_get_sync(Gio.BusType.SYSTEM)
|
||||
|
||||
# #首先设置systemd默认延长时间为1800
|
||||
# bus = dbus.SystemBus()
|
||||
# logind_proxy = bus.get_object('org.freedesktop.login1', '/org/freedesktop/login1')
|
||||
# getter_interface = dbus.Interface(
|
||||
# logind_proxy,
|
||||
# dbus_interface='org.freedesktop.login1.Manager')
|
||||
# ret = getter_interface.SetInhibitDelayMaxSec(1800)
|
||||
#首先设置systemd默认延长时间为1800
|
||||
bus = dbus.SystemBus()
|
||||
logind_proxy = bus.get_object('org.freedesktop.login1', '/org/freedesktop/login1')
|
||||
getter_interface = dbus.Interface(
|
||||
logind_proxy,
|
||||
dbus_interface='org.freedesktop.login1.Manager')
|
||||
ret = getter_interface.SetInhibitDelayMaxSec(1800)
|
||||
|
||||
var, fdlist = connection.call_with_unix_fd_list_sync(
|
||||
'org.freedesktop.login1', '/org/freedesktop/login1',
|
||||
|
|
|
@ -75,10 +75,10 @@ class UpdateManager():
|
|||
|
||||
self.update_essential_pkgs()
|
||||
|
||||
#是否开启关机后安装或者重启安装模式
|
||||
if self.is_shutdown_model() == True:
|
||||
logging.info("Initialize Shutdown Install Model...")
|
||||
self._prepare_shutdown_model()
|
||||
# #是否开启关机后安装或者重启安装模式
|
||||
# if self.is_shutdown_model() == True:
|
||||
# logging.info("Initialize Shutdown Install Model...")
|
||||
# self._prepare_shutdown_model()
|
||||
|
||||
self.only_update_cache()
|
||||
|
||||
|
@ -213,6 +213,8 @@ class UpdateManager():
|
|||
install_backend = get_backend(self, InstallBackend.ACTION_DOWNLOADONLY,upgrade_mode)
|
||||
install_backend.start(partial_upgrade_list)
|
||||
else:
|
||||
logging.info("Initialize Shutdown Install Model...")
|
||||
self._prepare_shutdown_model()
|
||||
resolver_backend = get_backend(self, InstallBackend.ACTION_CHECK_RESOLVER,upgrade_mode)
|
||||
resolver_backend.start(partial_upgrade_list)
|
||||
else:
|
||||
|
|
|
@ -7,7 +7,7 @@ Type=dbus
|
|||
Restart=always
|
||||
RestartSec=3
|
||||
BusName=com.kylin.systemupgrade
|
||||
ExecStart=/usr/share/kylin-system-updater/kylin-system-updater
|
||||
ExecStart=/usr/share/kylin-system-updater/kylin-system-updater -n
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
|
@ -25,4 +25,3 @@ unattended-upgrades/kylin-unattended-upgrade /usr/bin
|
|||
unattended-upgrades/kylin-unattended-upgrade-shutdown /usr/bin
|
||||
unattended-upgrades/kylin-unattended-upgrades /etc/apt/apt.conf.d/
|
||||
unattended-upgrades/logrotate.d/* /etc/logrotate.d/
|
||||
unattended-upgrades/kylin-unattended-upgrades-logind-maxdelay.conf /usr/lib/systemd/logind.conf.d/
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
[Login]
|
||||
# delay
|
||||
InhibitDelayMaxSec=1800
|
Loading…
Reference in New Issue