去除uu关机延时,开启动态配置

This commit is contained in:
Xueyi Luo 2022-05-06 16:45:29 +08:00
parent 91d94945ca
commit 7e36680ab8
5 changed files with 14 additions and 16 deletions

View File

@ -822,13 +822,13 @@ def inhibit_sleep():
from gi.repository import Gio, GLib from gi.repository import Gio, GLib
connection = Gio.bus_get_sync(Gio.BusType.SYSTEM) connection = Gio.bus_get_sync(Gio.BusType.SYSTEM)
# #首先设置systemd默认延长时间为1800 #首先设置systemd默认延长时间为1800
# bus = dbus.SystemBus() bus = dbus.SystemBus()
# logind_proxy = bus.get_object('org.freedesktop.login1', '/org/freedesktop/login1') logind_proxy = bus.get_object('org.freedesktop.login1', '/org/freedesktop/login1')
# getter_interface = dbus.Interface( getter_interface = dbus.Interface(
# logind_proxy, logind_proxy,
# dbus_interface='org.freedesktop.login1.Manager') dbus_interface='org.freedesktop.login1.Manager')
# ret = getter_interface.SetInhibitDelayMaxSec(1800) ret = getter_interface.SetInhibitDelayMaxSec(1800)
var, fdlist = connection.call_with_unix_fd_list_sync( var, fdlist = connection.call_with_unix_fd_list_sync(
'org.freedesktop.login1', '/org/freedesktop/login1', 'org.freedesktop.login1', '/org/freedesktop/login1',

View File

@ -75,10 +75,10 @@ class UpdateManager():
self.update_essential_pkgs() self.update_essential_pkgs()
#是否开启关机后安装或者重启安装模式 # #是否开启关机后安装或者重启安装模式
if self.is_shutdown_model() == True: # if self.is_shutdown_model() == True:
logging.info("Initialize Shutdown Install Model...") # logging.info("Initialize Shutdown Install Model...")
self._prepare_shutdown_model() # self._prepare_shutdown_model()
self.only_update_cache() self.only_update_cache()
@ -213,6 +213,8 @@ class UpdateManager():
install_backend = get_backend(self, InstallBackend.ACTION_DOWNLOADONLY,upgrade_mode) install_backend = get_backend(self, InstallBackend.ACTION_DOWNLOADONLY,upgrade_mode)
install_backend.start(partial_upgrade_list) install_backend.start(partial_upgrade_list)
else: else:
logging.info("Initialize Shutdown Install Model...")
self._prepare_shutdown_model()
resolver_backend = get_backend(self, InstallBackend.ACTION_CHECK_RESOLVER,upgrade_mode) resolver_backend = get_backend(self, InstallBackend.ACTION_CHECK_RESOLVER,upgrade_mode)
resolver_backend.start(partial_upgrade_list) resolver_backend.start(partial_upgrade_list)
else: else:

View File

@ -7,7 +7,7 @@ Type=dbus
Restart=always Restart=always
RestartSec=3 RestartSec=3
BusName=com.kylin.systemupgrade BusName=com.kylin.systemupgrade
ExecStart=/usr/share/kylin-system-updater/kylin-system-updater ExecStart=/usr/share/kylin-system-updater/kylin-system-updater -n
[Install] [Install]
WantedBy=multi-user.target WantedBy=multi-user.target

View File

@ -25,4 +25,3 @@ unattended-upgrades/kylin-unattended-upgrade /usr/bin
unattended-upgrades/kylin-unattended-upgrade-shutdown /usr/bin unattended-upgrades/kylin-unattended-upgrade-shutdown /usr/bin
unattended-upgrades/kylin-unattended-upgrades /etc/apt/apt.conf.d/ unattended-upgrades/kylin-unattended-upgrades /etc/apt/apt.conf.d/
unattended-upgrades/logrotate.d/* /etc/logrotate.d/ unattended-upgrades/logrotate.d/* /etc/logrotate.d/
unattended-upgrades/kylin-unattended-upgrades-logind-maxdelay.conf /usr/lib/systemd/logind.conf.d/

View File

@ -1,3 +0,0 @@
[Login]
# delay
InhibitDelayMaxSec=1800