mirror of
https://github.com/altlinux/gpupdate.git
synced 2025-01-05 05:17:52 +03:00
Added prevention of unnecessary startup of the gpupdate.service
This commit is contained in:
parent
99a6e85ccf
commit
aa4bf9a7c8
@ -37,6 +37,9 @@ class systemd_unit:
|
||||
if self.desired_state == 1:
|
||||
self.manager.UnmaskUnitFiles([self.unit_name], dbus.Boolean(False))
|
||||
self.manager.EnableUnitFiles([self.unit_name], dbus.Boolean(False), dbus.Boolean(True))
|
||||
if self.unit_name == 'gpupdate.service':
|
||||
if self.manager.GetUnitFileState(dbus.String(self.unit_name)) == 'enabled':
|
||||
return
|
||||
self.manager.StartUnit(self.unit_name, 'replace')
|
||||
logdata = dict()
|
||||
logdata['unit'] = self.unit_name
|
||||
|
@ -42,15 +42,14 @@ class systemd_applier(applier_frontend):
|
||||
|
||||
def run(self):
|
||||
for setting in self.systemd_unit_settings:
|
||||
valuename = setting.hive_key.rpartition('/')[2]
|
||||
try:
|
||||
self.units.append(systemd_unit(valuename, int(setting.data)))
|
||||
self.units.append(systemd_unit(setting.valuename, int(setting.data)))
|
||||
logdata = dict()
|
||||
logdata['unit'] = format(valuename)
|
||||
logdata['unit'] = format(setting.valuename)
|
||||
log('I4', logdata)
|
||||
except Exception as exc:
|
||||
logdata = dict()
|
||||
logdata['unit'] = format(valuename)
|
||||
logdata['unit'] = format(setting.valuename)
|
||||
logdata['exc'] = exc
|
||||
log('I5', logdata)
|
||||
for unit in self.units:
|
||||
|
Loading…
Reference in New Issue
Block a user