Univention Bugzilla – Attachment 9492 Details for
Bug 45802
4.2: Listener module for generating netlogon scripts is too slow
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
move LDAP init to prerun()
45802_LDAP_init_in_prerun.patch (text/plain), 1.63 KB, created by
Daniel Tröder
on 2018-04-09 15:21:12 CEST
(
hide
)
Description:
move LDAP init to prerun()
Filename:
MIME Type:
Creator:
Daniel Tröder
Created:
2018-04-09 15:21:12 CEST
Size:
1.63 KB
patch
obsolete
>diff --git a/ucs-school-netlogon-user-logonscripts/ucs-school-user-logonscript.py b/ucs-school-netlogon-user-logonscripts/ucs-school-user-logonscript.py >index 37bd8415..3195e9c4 100755 >--- a/ucs-school-netlogon-user-logonscripts/ucs-school-user-logonscript.py >+++ b/ucs-school-netlogon-user-logonscripts/ucs-school-user-logonscript.py >@@ -54,6 +54,7 @@ attributes = [] > > FN_PID = '/var/run/ucs-school-user-logonscript-daemon.pid' > time_me = listener.configRegistry.is_true('ucsschool/userlogon/benchmark') >+lo = None > > > class Log(object): >@@ -180,17 +181,22 @@ def handle_user(dn, new, old, lo, user_queue): > > > def handler(dn, new, old): >+ global lo >+ > timer.reset_timer() > timer.add_timing('handler start') > > attrs = new if new else old > >+ timer.add_timing('handler init 0') > listener.setuid(0) > try: >- lo = getMachineConnection()[0] >+ timer.add_timing('handler init 1') >+ if not lo: >+ lo = getMachineConnection()[0] >+ timer.add_timing('handler init 2') > user_queue = SqliteQueue(logger=Log) >- >- timer.add_timing('handler init') >+ timer.add_timing('handler init 3') > > # identify object > if users_user_module.identify(dn, attrs): >@@ -267,6 +273,25 @@ def clean(): > listener.unsetuid() > > >+def prerun(): >+ global lo >+ timer.add_timing('prerun start') >+ if not lo: >+ listener.setuid(0) >+ try: >+ lo = getMachineConnection()[0] >+ finally: >+ listener.unsetuid() >+ timer.add_timing('prerun end') >+ >+ > def postrun(): >+ global lo >+ timer.add_timing('postrun start') >+ if lo: >+ lo.unbind() >+ lo = None >+ timer.add_timing('postrun end') >+ > if time_me: > Log.process('Timer total:\n{!s}'.format('\n'.join(timer.sprint_timer_total())))
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 45802
: 9492