|
Lines 118-124
def _restart_connector():
Link Here
|
| 118 |
try: |
118 |
try: |
| 119 |
if not subprocess.call(['pgrep', '-f', 'python.*s4connector.s4.main']): |
119 |
if not subprocess.call(['pgrep', '-f', 'python.*s4connector.s4.main']): |
| 120 |
univention.debug.debug(univention.debug.LISTENER, univention.debug.PROCESS, "s4-connector: restarting connector ...") |
120 |
univention.debug.debug(univention.debug.LISTENER, univention.debug.PROCESS, "s4-connector: restarting connector ...") |
| 121 |
subprocess.call(('service', 'univention-s4-connector', 'restart')) |
121 |
subprocess.call(('systemctl', 'restart', 'univention-s4-connector')) |
| 122 |
univention.debug.debug(univention.debug.LISTENER, univention.debug.PROCESS, "s4-connector: ... done") |
122 |
univention.debug.debug(univention.debug.LISTENER, univention.debug.PROCESS, "s4-connector: ... done") |
| 123 |
finally: |
123 |
finally: |
| 124 |
listener.unsetuid() |
124 |
listener.unsetuid() |
|
Lines 138-144
def handler(dn, new, old, command):
Link Here
|
| 138 |
if b'univentionUDMProperty' in new.get('objectClass', []) or b'univentionUDMProperty' in old.get('objectClass', []): |
138 |
if b'univentionUDMProperty' in new.get('objectClass', []) or b'univentionUDMProperty' in old.get('objectClass', []): |
| 139 |
connector_needs_restart = True |
139 |
connector_needs_restart = True |
| 140 |
else: |
140 |
else: |
| 141 |
if connector_needs_restart is True: |
141 |
if connector_needs_restart and not s4_init_mode: |
| 142 |
_restart_connector() |
142 |
_restart_connector() |
| 143 |
connector_needs_restart = False |
143 |
connector_needs_restart = False |
| 144 |
|
144 |
|
|
Lines 217-223
def postrun():
Link Here
|
| 217 |
finally: |
217 |
finally: |
| 218 |
listener.unsetuid() |
218 |
listener.unsetuid() |
| 219 |
|
219 |
|
| 220 |
if connector_needs_restart is True: |
220 |
if connector_needs_restart: |
| 221 |
_restart_connector() |
221 |
_restart_connector() |
| 222 |
connector_needs_restart = False |
222 |
connector_needs_restart = False |
| 223 |
|
223 |
|