Univention Bugzilla – Attachment 10024 Details for
Bug 42241
Can't start/stop/restart Samba4 Service via UMC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch (git:fbest/42241-fix-samba-service-detection)
42241.patch (text/plain), 2.94 KB, created by
Florian Best
on 2019-05-13 14:48:24 CEST
(
hide
)
Description:
patch (git:fbest/42241-fix-samba-service-detection)
Filename:
MIME Type:
Creator:
Florian Best
Created:
2019-05-13 14:48:24 CEST
Size:
2.94 KB
patch
obsolete
>commit 33d8a6b16d3489821f5563f0db104ccfdbafc2b0 >Author: Florian Best <best@univention.de> >Date: Mon May 13 14:43:53 2019 +0200 > > Bug #42241: fix detection of samba4 service > >diff --git a/base/univention-config-registry/python/univention/service_info.py b/base/univention-config-registry/python/univention/service_info.py >index 42ce601350..77010d0891 100644 >--- a/base/univention-config-registry/python/univention/service_info.py >+++ b/base/univention-config-registry/python/univention/service_info.py >@@ -98,6 +98,7 @@ def pidof(name, docker='/var/run/docker.pid'): > try: > with open(cmdline, 'r') as fd: > commandline = fd.read() >+ link = os.readlink(os.path.join('/proc', proc, 'exe')) > except EnvironmentError: > continue > # kernel thread >@@ -115,13 +116,14 @@ def pidof(name, docker='/var/run/docker.pid'): > log.error('Failed getting parent: %s', ex) > > args = commandline.split('\0') >- if cmd[0] not in args and not commandline.startswith(name): >- log.debug('skip %d: %s', pid, commandline) >- continue >- if len(args) >= len(cmd) > 1: >- if any(a != c for a, c in zip(args, cmd)): >- log.debug('mismatch %d: %r != %r', pid, args, cmd) >+ if len(cmd) != 1 or link not in cmd: >+ if cmd[0] not in args and not commandline.startswith(name): >+ log.debug('skip %d: %s', pid, commandline) > continue >+ if len(args) >= len(cmd) > 1: >+ if any(a != c for a, c in zip(args, cmd)): >+ log.debug('mismatch %d: %r != %r', pid, args, cmd) >+ continue > log.info('found %d: %r', pid, commandline) > result.add(pid) > >diff --git a/management/univention-management-console-module-services/umc/python/services/__init__.py b/management/univention-management-console-module-services/umc/python/services/__init__.py >index 89cec8475b..5dfbfddeef 100644 >--- a/management/univention-management-console-module-services/umc/python/services/__init__.py >+++ b/management/univention-management-console-module-services/umc/python/services/__init__.py >@@ -97,13 +97,15 @@ class Instance(Base): > > def _change_services(self, services, action): > error_messages = [] >+ srvs = ServiceInfo() > for srv in services: >- process = subprocess.Popen(('/usr/sbin/service', srv, action), stdout=subprocess.PIPE, stderr=subprocess.STDOUT) >+ service_name = srvs.get_service(srv).get('systemd', srv) >+ process = subprocess.Popen(('/usr/sbin/service', service_name, action), stdout=subprocess.PIPE, stderr=subprocess.STDOUT) > output = process.communicate()[0] > if process.returncode: > try: >- MODULE.warn('Error during %s of %s: %s' % (action, srv, output.strip())) >- process = subprocess.Popen(('/bin/systemctl', 'status', srv), stdout=subprocess.PIPE, stderr=subprocess.STDOUT) >+ MODULE.warn('Error during %s of %s: %s' % (action, service_name, output.strip())) >+ process = subprocess.Popen(('/bin/systemctl', 'status', service_name), stdout=subprocess.PIPE, stderr=subprocess.STDOUT) > output = process.communicate()[0] > except EnvironmentError: > pass
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 42241
: 10024