Bug 51835 - create_spn_account.sh should evaluate create_spn_account_timeout
create_spn_account.sh should evaluate create_spn_account_timeout
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Samba4
UCS 4.4
Other Windows NT
: P5 normal (vote)
: UCS 4.4-6-errata
Assigned To: Felix Botner
Samba maintainers
:
Depends on:
Blocks: 52367
  Show dependency treegraph
 
Reported: 2020-08-18 17:10 CEST by Michael Grandjean
Modified: 2020-11-18 16:43 CET (History)
4 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 6: Setup Problem: Issue for the setup process
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 3: A User would likely not purchase the product
User Pain: 0.206
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Grandjean univentionstaff 2020-08-18 17:10:26 CEST
# univention-app info
UCS: 4.4-5 errata710
Installed: samba4=4.10 self-service=4.0 self-service-backend=4.0 ucsschool=4.4 v6
Upgradable:

Scenario:
In "98univention-samba4-dns.inst" we create a SPN account named "dns-hostname$" using the script "create_spn_account.sh". Because the user is created via UDM on the UCS Master, but must be available on the local machine for upcoming steps in the join script, the script waits until it can find the account in the local Samba AD directory:

https://github.com/univention/univention-corporate-server/blob/4.4-5/services/univention-samba4/scripts/create_spn_account.sh#L131

There is a $timeout variable that defaults to "1200" (2 hours). The variable can be changed via "create_spn_account_timeout".

Expected behavior:
I can define "create_spn_account_timeout" prior to the join and this affects the timeout. There are environments where the 2 hours are not enough (see also Bug #47609).

Observed behavior:
"create_spn_account_timeout" does not get evaluated and the joinscript aborts after waiting for 2 hours for the "dns-hostname$" account to be available in the local Samba AD.
As a consequence the whole join aborts. This is especially painful if the join itself takes several hours in larger environments and has to be presumed manually after waiting long enough for the replication and s4-connector to catch up.

Possible solution:
"create_spn_account.sh" could simply do a "eval $(ucr shell create/spn/account/timeout)". This way "create/spn/account/timeout" could be defined via a UCR policy and would be set locally at the beginning of the join and before "98univention-samba4-dns.inst" is called.
Comment 1 Michael Grandjean univentionstaff 2020-08-18 17:15:19 CEST
The "Scenario" section should have mentioned: 
"Joining a UCS@school schoolserver to a UCS@school domain with a larger user base (>50.000)"
Comment 3 Christian Castens univentionstaff 2020-11-06 13:27:22 CET
Package: univention-samba4
Version: 8.0.0-33A~4.4.0.202011061228
Branch: ucs_4.4-0
Scope: errata4.4-6

commits 4.4-6:
053afd2b79410eb1d0f9c9a7c1b425507a22c7e1 (yaml)
b62560266d180ce247474278e39b1799aac9b124 (changelog)
9cad74a2fd610495b76d5dd5ff08a6891ba9c107 (ucrv description)
e421a7ddc10348494a91049d6e0731c3f8a52ff6 (ucrv implementation)

the ucr variable "create/spn/account/timeout" is now being evaluated in script "create_spn_account.sh" which is used in join script "98univention-samba4-dns.inst"
Comment 4 Christian Castens univentionstaff 2020-11-06 14:06:26 CET
5.0-0 merge request
https://git.knut.univention.de/univention/ucs/-/merge_requests/27
Comment 5 Felix Botner univentionstaff 2020-11-06 15:55:34 CET
OK - timeout /usr/share/univention-samba4/scripts/create_spn_account.sh configurable via create/spn/account/timeout
OK - YAML
OK - MR
Comment 6 Felix Botner univentionstaff 2020-11-09 11:22:31 CET
As discussed, we want the default timeout in create_spn_account.sh to be 10800s
Comment 7 Felix Botner univentionstaff 2020-11-09 11:33:13 CET
New default timeout in create_spn_account.sh is 10800s.

univention-samba4
78ab264254af75358ffb04239b0e6682a53c5be7
a56dd59a8db39d58720b9690af4e919124f021de

updated MR
Comment 8 Erik Damrose univentionstaff 2020-11-16 09:44:40 CET
OK: updated default timeout
OK: ucr info updated
OK: merge request updated
OK: yaml
Doc: bug 52367
Verified