Bug 44694 - sysvol-sync.sh stops working if homedir for Samba/AD DCs is not /dev/null (4.2)
sysvol-sync.sh stops working if homedir for Samba/AD DCs is not /dev/null (4.2)
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Samba4
UCS 4.2
Other Linux
: P5 normal (vote)
: UCS 4.2-0-errata
Assigned To: Arvid Requate
Felix Botner
:
Depends on:
Blocks: 44695
  Show dependency treegraph
 
Reported: 2017-05-24 18:32 CEST by Arvid Requate
Modified: 2017-12-12 07:52 CET (History)
1 user (show)

See Also:
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:
requate: Patch_Available+


Attachments
fix-sysvol-sync.patch (591 bytes, patch)
2017-05-24 18:32 CEST, Arvid Requate
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>