Bug 46486 - sysvol-sync.sh: process lock doesn't work as intended.
sysvol-sync.sh: process lock doesn't work as intended.
Product: UCS
Classification: Unclassified
Component: Samba4
UCS 4.2
Other Linux
: P5 normal (vote)
: UCS 4.3-0-errata
Assigned To: Felix Botner
Arvid Requate
Depends on:
  Show dependency treegraph
Reported: 2018-03-05 11:50 CET by Eduard Mai
Modified: 2018-03-28 13:28 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 3: Will affect average number of installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.103
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Note You need to log in before you can comment on or make changes to this bug.
Description Eduard Mai univentionstaff 2018-03-05 11:50:51 CET
Line 327f in sysvol-sync.sh: 
# get a lock, prevent script from running twice
flock -un 9 || exit 0

-u drops a lock ("unlock") on the given file descriptor.

To reproduce add a read after the flock command and run sysvol-sync.sh 2 times. Two processes should wait for input. Removing the -u option makes all subsequent processes exit as intended.
Comment 1 Arvid Requate univentionstaff 2018-03-05 13:07:17 CET
uh, bummer.
Comment 2 Stefan Gohmann univentionstaff 2018-03-15 06:36:57 CET
Move to 4.3-0-errata. If a UCS 4.2 backport is needed, please clone this issue.
Comment 3 Felix Botner univentionstaff 2018-03-19 17:27:07 CET
univention-samba4: 68c51de421b52458b48143973a8c8fa4bd55ffba
removed -u from flock

yaml: 5b02ac00e9cad9642eeb4498b0af310d19a26492
Comment 4 Arvid Requate univentionstaff 2018-03-22 13:23:03 CET
Ok, works now.
Comment 5 Arvid Requate univentionstaff 2018-03-28 13:28:37 CEST