Bug 58542 - samba-ad-dc not running after server reboot
Summary: samba-ad-dc not running after server reboot
Status: NEW
Alias: None
Product: UCS
Classification: Unclassified
Component: General
Version: UCS 5.2
Hardware: Other Linux
: P5 normal
Target Milestone: ---
Assignee: UCS maintainers
QA Contact: UCS maintainers
URL:
Keywords:
Depends on: 44237
Blocks:
  Show dependency treegraph
 
Reported: 2025-08-25 14:51 CEST by Christina Scheinig
Modified: 2025-09-01 08:30 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary scenarios
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 5: Blocking further progress on the daily work
User Pain: 0.114
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number: 2025082121000084
Bug group (optional):
Customer ID:
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christina Scheinig univentionstaff 2025-08-25 14:51:44 CEST
syslog shows:

2025-08-21T06:57:01.379685+02:00 ucs01 systemd[1]: Starting samba-ad-dc.service - LSB: Samba daemons for the AD DC...
2025-08-21T06:57:01.822250+02:00 ucs01 systemd[1]: Started samba-ad-dc.service - LSB: Samba daemons for the AD DC.
2025-08-21T07:08:02.137412+02:00 ucs01 systemd[1]: remote-fs.target: Found ordering cycle on samba-ad-dc.service/stop
2025-08-21T07:08:02.137618+02:00 ucs01 systemd[1]: remote-fs.target: Found dependency on named.service/stop
2025-08-21T07:08:02.137712+02:00 ucs01 systemd[1]: remote-fs.target: Found dependency on nss-lookup.target/stop
2025-08-21T07:08:02.137776+02:00 ucs01 systemd[1]: remote-fs.target: Found dependency on rpc-statd.service/stop
2025-08-21T07:08:02.137846+02:00 ucs01 systemd[1]: remote-fs.target: Found dependency on nfs-server.service/stop
2025-08-21T07:08:02.137911+02:00 ucs01 systemd[1]: remote-fs.target: Found dependency on usr-share-ppd-custom.mount/stop
2025-08-21T07:08:02.137977+02:00 ucs01 systemd[1]: remote-fs.target: Found dependency on remote-fs.target/stop
2025-08-21T07:08:02.138047+02:00 ucs01 systemd[1]: remote-fs.target: Job samba-ad-dc.service/stop deleted to break ordering cycle starting with remote-fs.target/stop
2025-08-21T07:08:02.144871+02:00 ucs01 systemd[1]: system-check\x2dmk\x2dagent.slice: Consumed 2min 49.627s CPU time.

looks like a systemd dependency cycle.

:~# systemctl status usr-share-ppd-custom.mount
Warning: The unit file, source configuration file or drop-ins of usr-share-ppd-custom.mount changed on disk. Run 'systemctl daemon-reload' to reload units.
● usr-share-ppd-custom.mount - /usr/share/ppd/custom
     Loaded: loaded (/etc/fstab; generated)
     Active: active (mounted) since Thu 2025-08-21 07:08:42 CEST; 5h 17min ago
      Where: /usr/share/ppd/custom
       What: 10.1.0.10:/home/printer-workbench/PPD-Files/custom
       Docs: man:fstab(5)
             man:systemd-fstab-generator(8)
      Tasks: 0 (limit: 38451)
     Memory: 164.0K
        CPU: 4ms
     CGroup: /system.slice/usr-share-ppd-custom.mount

Aug 21 07:08:42 ucs01 systemd[1]: Mounting usr-share-ppd-custom.mount - /usr/share/ppd/custom...
Aug 21 07:08:42 ucs01 systemd[1]: Mounted usr-share-ppd-custom.mount - /usr/share/ppd/custom.

:~# cat /etc/fstab | grep ppd
10.1.0.10:/home/printer-workbench/PPD-Files/custom      /usr/share/ppd/custom   nfs     defaults        0       0       #LDAP Entry DN: cn=ppd-files,cn=shares,dc=schein,dc=me
------------------------------------------------------------------------------------
:~# systemctl cat usr-share-ppd-custom.mount
# Warning: usr-share-ppd-custom.mount changed on disk, the version systemd has loaded is outdated.
# This output shows the current version of the unit's original fragment and drop-in files.
# If fragments or drop-ins were added or removed, they are not properly reflected in this output.
# Run 'systemctl daemon-reload' to reload units.
# /run/systemd/generator/usr-share-ppd-custom.mount
# Automatically generated by systemd-fstab-generator

[Unit]
Documentation=man:fstab(5) man:systemd-fstab-generator(8)
SourcePath=/etc/fstab
Before=remote-fs.target

[Mount]
What=10.1.0.10:/home/printer-workbench/PPD-Files/custom
Where=/usr/share/ppd/custom
Type=nfs

and samba has also the remote-fs.target as a dependency. The question is, if this is necessary, and if the autogenerated samba systemd config is still a good idea. samba already ships a systemd configuration.

On the customes system:
--------------------------------------------------------------------------------------------------
:~# systemctl cat samba-ad-dc.service 
# /run/systemd/generator.late/samba-ad-dc.service
# Automatically generated by systemd-sysv-generator

[Unit]
Documentation=man:systemd-sysv-generator(8)
SourcePath=/etc/init.d/samba-ad-dc
Description=LSB: Samba daemons for the AD DC
Before=multi-user.target
Before=multi-user.target
Before=multi-user.target
Before=graphical.target
After=network-online.target
After=remote-fs.target
Wants=network-online.target

[Service]
Type=forking
Restart=no
TimeoutSec=5min
IgnoreSIGPIPE=no
KillMode=process
GuessMainPID=no
RemainAfterExit=yes
SuccessExitStatus=5 6
ExecStart=/etc/init.d/samba-ad-dc start
ExecStop=/etc/init.d/samba-ad-dc stop


and samba default
--------------------------------------------------------------------------------

cat /etc/systemd/system/multi-user.target.wants/samba-ad-dc.service 

[Unit]
Description=Samba AD Daemon
Documentation=man:samba(8) man:samba(7) man:smb.conf(5)
Wants=network-online.target

After=network.target network-online.target

[Service]
Type=notify
PIDFile=/run/samba/samba.pid
LimitNOFILE=16384
Environment=SAMBAOPTIONS=
EnvironmentFile=-/etc/default/samba
ExecStart=/usr/sbin/samba --foreground --no-process-group $SAMBAOPTIONS
ExecReload=/bin/kill -HUP $MAINPID
ExecCondition=/usr/share/samba/is-configured samba

[Install]
WantedBy=multi-user.target
# Upstream name:
Alias=samba.service
Comment 1 Christina Scheinig univentionstaff 2025-08-25 14:53:06 CEST
Workaround is, to restart samba-ad-dc manually after the server is up.
Comment 2 Arvid Requate univentionstaff 2025-08-25 19:05:50 CEST
Need more info, works for me

root@primary20:~# uptime
 19:02:58 up 0 min
root@primary20:~# univention-s4search  # works
root@primary20:~# kinit --password-file=/etc/machine.secret PRIMARY20$  # works

Please note Bug #44237
Comment 3 Christina Scheinig univentionstaff 2025-08-29 16:25:17 CEST
Which information is needed here?
Have you installed a policy which creates a share for mount in the /etc/fstab and where systemd creates a custom.mount with the systemd-fstab-generator?

Only with that, the service won't come up properly