Bug 44694

Summary: sysvol-sync.sh stops working if homedir for Samba/AD DCs is not /dev/null (4.2)
Product: UCS Reporter: Arvid Requate <requate>
Component: Samba4Assignee: Arvid Requate <requate>
Status: CLOSED FIXED QA Contact: Felix Botner <botner>
Severity: normal    
Priority: P5 CC: gohmann
Version: UCS 4.2Flags: requate: Patch_Available+
Target Milestone: UCS 4.2-0-errata   
Hardware: Other   
OS: Linux   
What kind of report is it?: Bug Report What type of bug is this?: 5: Major Usability: Impairs usability in key 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.143 Enterprise Customer affected?: Yes
School Customer affected?: ISV affected?:
Waiting Support: Flags outvoted (downgraded) after PO Review:
Ticket number: 2017052321000387 Bug group (optional):
Max CVSS v3 score:
Bug Depends on:    
Bug Blocks: 44695    
Attachments: fix-sysvol-sync.patch

Description Arvid Requate univentionstaff 2017-05-24 18:32:30 CEST
Created attachment 8881 [details]
fix-sysvol-sync.patch

sysvol-sync.sh stops working if homedir for Samba/AD DCs in not /dev/null.
In that case it never synchronizes anything from that DC.

The sed expression used in the check_if_need_sync function suffers from a sed feature called "Relentness" here: http://sed.sourceforge.net/sedfaq3.html#s3.3

It's surprisingly difficult to create a sed expression for this use case.
The attached patch avoids sed at this point.
Comment 1 Arvid Requate univentionstaff 2017-06-01 19:43:59 CEST
I fixed this along with Bug #43620.
Comment 2 Felix Botner univentionstaff 2017-06-08 15:11:47 CEST
I would prefer something like this

-> univention-ssh-rsync /etc/machine.secret --dry-run  --out-format='%n' \
  -auAX  --dirs-update --delete \
  'slave$@master:/var/lib/samba/sysvol/' \
  /var/cache/univention-samba4/sysvol-sync/.master  2>/dev/null
deleting four.two/Policies/{085209BD-1E7A-4E08-A0BF-C4764CE9DA82}/User/
deleting four.two/Policies/{085209BD-1E7A-4E08-A0BF-C4764CE9DA82}/Machine/
deleting four.two/Policies/{085209BD-1E7A-4E08-A0BF-C4764CE9DA82}/GPT.INI
deleting four.two/Policies/{085209BD-1E7A-4E08-A0BF-C4764CE9DA82}/
four.two/Policies/
four.two/Policies/{6AC1786C-016F-11D2-945F-00C04FB984F9}/


without -v, -> no putput

with 2>/dev/null -> removes the "Could not chdir to home directory /dev/null..." message

with --out-format='%n', print changes

This way we don't need to grep/tail/sed the output, if there is output, there are changes.
Comment 3 Felix Botner univentionstaff 2017-06-14 10:14:20 CEST
Request rejected
Comment 4 Felix Botner univentionstaff 2017-06-14 10:56:44 CEST
OK - sysvol-sync.sh with unixHome != /dev/null (but lets hope rsync output
     format does not change)
OK - YAML
Comment 5 Janek Walkenhorst univentionstaff 2017-06-15 17:58:21 CEST
<http://errata.software-univention.de/ucs/4.2/42.html>