Univention Bugzilla – Bug 42241
Can't start/stop/restart Samba4 Service via UMC
Last modified: 2019-09-03 10:19:58 CEST
System Services shows a Service called 'Samba4' which can't be stopped, started or restarted via the Management Console. 'Samba4' displays the Status of the samba/smbd/samba-ad-dc Service but can't manage it. ---------------------- Popup when trying to start/stop/restart: Internal module error: An error occured during command processing. Server error message: Restarting the following services failed: samba4 ---------------------- The Log-File /var/log/univention/management-console-module-services.log only shows the following, when trying to restart via the Restart-Button: 02.09.16 16:23:28.531 MODULE ( ERROR ) : ['services/restart'] No other messages are shown, when trying to Start/Stop the app. ---------------------- Note: The following Apps where installed: Active Directory-compatible Domain Controller (DHCP server SiouxApp Business Suite SiouxApp DokuWiki)
Did this happen with UCS 4.1 or UCS 4.2? The error handling will be solved via Bug #36562.
4.1, sorry.
UCS 4.1 is missing the symlink "/etc/init.d/samba4". In UCS 3.3 it existed, linking to "/etc/init.d/samba-ad-dc". As workaround create the symlink yourself and voila - UMC can start/stop/restart the samba4 service again.
There is a Customer ID set so I set the flag "Enterprise Customer affected".
UCS 4.2 still has this problem - samba4 cannot be managed from System Services. Since 4.2 uses systemd the workaround for earlier UCS versions does not work anymore. I helped myself by adding a symlink "/run/systemd/generator.late/samba4.service" showing to "/run/systemd/generator.late/samba-ad-dc.service".
This issue has been filled against UCS 4.1. The maintenance with bug and security fixes for UCS 4.1 has ended on 5st of April 2018. Customers still on UCS 4.1 are encouraged to update to UCS 4.3. Please contact your partner or Univention for any questions. If this issue still occurs in newer UCS versions, please use "Clone this bug" or simply reopen the issue. In this case please provide detailed information on how this issue is affecting you.
I need to reopen this bug because after upgrade to UCS 4.4 I have exactly the same problem.
I can confirm this: UMC displays a service named samba4 which is always displayed as stopped. Clicking on start causes the error message: """ Starting the service samba4 failed: Unit samba4.service could not be found. """ The process list shows a samba process: root 16042 0.2 1.4 612100 43544 ? Ss 16:16 0:00 samba: root process root 16061 0.0 0.9 612100 27892 ? S 16:16 0:00 \_ samba: task[s3fs_parent] root 16063 0.0 0.7 612104 22408 ? S 16:16 0:00 | \_ samba: tfork waiter process root 16062 0.0 1.2 616352 38544 ? S 16:16 0:00 \_ samba: task[dcesrv] root 16064 0.0 0.9 614712 28980 ? S 16:16 0:00 \_ samba: task[wreplsrv] root 16066 0.1 1.1 612100 34152 ? S 16:16 0:00 \_ samba: task[ldapsrv] root 18711 0.6 1.2 616968 39224 ? S 16:19 0:00 | \_ samba: conn[ldap] c[unix:] s[unix:/var/lib/samba/private/ldap_priv/ldapi] server_id[18711] root 16067 0.0 0.9 612100 30828 ? S 16:16 0:00 \_ samba: task[cldapd] root 16068 0.0 1.3 616352 40124 ? S 16:16 0:00 \_ samba: task[kdc] root 16069 0.0 1.0 612100 32596 ? S 16:16 0:00 \_ samba: task[dreplsrv] root 16070 0.0 0.9 612100 27828 ? S 16:16 0:00 \_ samba: task[winbindd_parent] root 16073 0.0 0.7 612104 23844 ? S 16:16 0:00 | \_ samba: tfork waiter process root 16071 0.0 1.0 612100 31196 ? S 16:16 0:00 \_ samba: task[ntp_signd] root 16072 0.0 1.2 612100 38672 ? S 16:16 0:00 \_ samba: task[kccsrv] root 16074 0.0 1.0 612100 31780 ? S 16:16 0:00 \_ samba: task[dnsupdate] # ls -l /proc/16042/exe lrwxrwxrwx 1 root root 0 Mär 11 16:17 /proc/16042/exe -> /usr/sbin/samba # cat /etc/univention/service.info/services/univention-samba4.cfg [samba4] description[de]=Stellt Dienste für Windows Systeme zur Verfügung description[en]=Provides Services for Windows icon=service/samba programs=/usr/sbin/samba start_type=samba4/autostart systemd=samba-ad-dc.service Is the systemd entry wrong?
*** Bug 49215 has been marked as a duplicate of this bug. ***
Happened for a customer.
Created attachment 10024 [details] patch (git:fbest/42241-fix-samba-service-detection) Attached is a patch for: 1. the detection of running service which rewrite their process arguments /proc/$pid/cmdline as samba does. Detect via len(args) == 1 and symlink(/proc/$pid/exe) == args[0]) 2. use of the correct systemd service definition from the service configuration file: /etc/univention/service.info/services/univention-samba4.cfg defines the service "samba4" with systemd=samba-ad-dc.service. but the UMC code called "service samba4 restart" instead of "service samba-ad-dc.service restart". This affects also (the probably broken services): [uvmm/novnc] systemd=univention-novnc.service and [openbsd-inetd] systemd=inetd.service
postfix is also broken: service definiton: /usr/lib/postfix/master running program: /usr/lib/postfix/sbin/master -w postgres is also broken: service definition: /usr/lib/postgresql/9.4/bin/postgres running programm: /usr/lib/postgresql/9.6/bin/postgres -D /var/lib/postgresql/9.6/main -c config_file=/etc/postgresql/9.6/main/postgresql.conf
Since Bug #49176 only the second file in the patch is necessary. The status of Samba should now already be detected correctly but start/stop/restarting is not possible. <http://errata.software-univention.de/ucs/4.4/119.html>
Sorry, I do not get it. What is fixed now with e119? Just the service display in UMC? Or the possibility to start/stop/restart at least samba4 (samba-ad-dc) through UMC? Happened for another customer, attaching ticket.
(In reply to Christian Völker from comment #14) > Sorry, I do not get it. > > What is fixed now with e119? > Just the service display in UMC? Yes, only that the state is detected correctly. > Or the possibility to start/stop/restart at least samba4 (samba-ad-dc) > through UMC? No, this is still not possible. Therefore there is the second file in the patch file of attachment 10024 [details].
Fixed the generic issue in the services module: Use the "systemd" definition of the service instead of the section name when restart/start/stop services. And fixed univention-postgresql by splitting it into two service files for each postgresql version. postgresql-9.6 was never displayed until now. It has the new UCR variable postgresql9.6/autostart. postgresql-9.4 has been fixed and uses the old UCR variable, which it used before, postgresql8/autostart. Also fixed the binary path for univention-mail-postfix, so that the service is visible again in UMC. univention-postgresql (11.0.1-2) c6eca30b9b0d | Bug #42241: fix univention service definition univention-mail-postfix.yaml d754c171455c | Bug #42241: fix service definition of postfix univention-mail-postfix (13.0.1-2) d754c171455c | Bug #42241: fix service definition of postfix univention-postgresql.yaml c6eca30b9b0d | Bug #42241: fix univention service definition univention-management-console-module-services (8.0.1-2) 25cb35f5c7c5 | Bug #42241: fix start/restart/stop of services with different systemd name than the service definition name univention-management-console-module-services (8.0.1-3) 220039464cba | Bug #42241: enhancement: service $foo.service does not work, only systemctl restart $foo.service works. Strip .service therefore. univention-management-console-module-services.yaml 25cb35f5c7c5 | Bug #42241: fix start/restart/stop of services with different systemd name than the service definition name
(In reply to Florian Best from comment #16) > Fixed the generic issue in the services module: > Use the "systemd" definition of the service instead of the section name when > restart/start/stop services. Unfortionately this must not be done for Samba 4 because of Bug #44237 and especially Bug #47634, as the samba service defintion defined only to restart samba-ad-dc. Because of this, I moved the start/stop/restart handling into service_info.py and introduced a "init_script=samba" in the samba service definition. If init_script is used, it uses /etc/init.d/$init_script $action to restart/… the service. univention-samba4 (8.0.0-26) 3d0ced99417e | Bug #42241: fix service definition of samba univention-management-console-module-services (8.0.1-4) 9de6f183ac1f | Bug #42241: move start/stop/restart logic into service_info.py univention-config-registry (14.0.0-11) df4b966c50b5 | Bug #42241: move start/stop/restart logic into service_info.py
Verified: * Code review * Package update * Functional test * Advisories
<http://errata.software-univention.de/ucs/4.4/219.html> <http://errata.software-univention.de/ucs/4.4/220.html> <http://errata.software-univention.de/ucs/4.4/221.html> <http://errata.software-univention.de/ucs/4.4/222.html> <http://errata.software-univention.de/ucs/4.4/223.html>
Those changes were never documented and caused a regression, when univention-install-service-info is invoked. [4.4-1] 7352ba9512 Bug #42241 ucr: Silence u-install-service-info warning .../doc/univention-install-service-info.1 | 10 +++++++++- .../python/univention/service_info.py | 2 +- doc/developer-reference/ucr/ucr.xml | 16 +++++++++++++++- 3 files changed, 25 insertions(+), 3 deletions(-)