Andrew Bartlett
2021-Nov-22 09:23 UTC
[Samba] samba 4.13: backup script: FileNotFoundError
On Mon, 2021-11-22 at 08:36 +0000, James Dingwall via samba wrote:> Hi, > > Ubuntu 20.04 recently updated samba from 4.11 to 4.13. Since then > the backup > script has started failing: > > running backup on dirs: /var/lib/samba/private /var/lib/samba > /etc/samba > ERROR(<class 'FileNotFoundError'>): uncaught exception - [Errno 2] No > such file or directory: '/var/lib/samba/dfs/netlogon' > File "/usr/lib/python3/dist-packages/samba/netcmd/__init__.py", > line 186, in _run > return self.run(*args, **kwargs) > File "/usr/lib/python3/dist- > packages/samba/netcmd/domain_backup.py", line 1105, in run > if any(os.path.samefile(full_path, file) for file in all_files): > File "/usr/lib/python3/dist- > packages/samba/netcmd/domain_backup.py", line 1105, in <genexpr> > if any(os.path.samefile(full_path, file) for file in all_files): > File "/usr/lib/python3.8/genericpath.py", line 100, in samefile > s1 = os.stat(f1) > > Assuming that I set my DFS up correctly I think the cause is that > 'netlogon' > is a dangling link: > > $ ls -l /var/lib/samba/dfs/netlogon > lrwxrwxrwx 1 root root 43 Mar 26 2021 /var/lib/samba/dfs/netlogon -> > msdfs:dc0\netlogon,dc1\netlogon > > Should the directory backup script handle this case or should I move > the [dfs] > share?Ideally it would handle this case. This regression was triggered by a fix for issues with hard links. However in general [sysvol] and [netlogon] should be real shares with the sync occouring server-side, not by forcing the client to a particular DC, as otherwise you don't have redundency. (However, the issue of how to sync and ensuring updates happen on the right DC is problemtatic). Andrew Bartlett -- Andrew Bartlett (he/him) https://samba.org/~abartlet/ Samba Team Member (since 2001) https://samba.org Samba Team Lead, Catalyst IT https://catalyst.net.nz/services/samba Samba Development and Support, Catalyst IT - Expert Open Source Solutions
-----Original Message-----> > However in general [sysvol] and [netlogon] should be real shares with > the sync occouring server-side, not by forcing the client to a > particular DC, as otherwise you don't have redundency. (However, the > issue of how to sync and ensuring updates happen on the right DC is > problemtatic). > > Andrew Bartlett >One hack-ish way around this today might be a Union Filesystem that has an upper writable area and a lower store for the replicated data. https://en.wikipedia.org/wiki/UnionFS Periodically (e.g. every 5 min) a synchronization script could run that would look for new files across all DCs currently online and push the newest file to the underlying store on each DC (if it were newer than existing files) before purging that file entry from the upper writable areas. Faster and probably more efficient, (event) Push rather than Pull replication. Samba could also be improved to support that: 1) Provide a single modify storage location entry (implicitly mirror directories from beneath) to eliminate the dependency on UFS or another similar solution. 2) Trigger an external program OR write to a FIFO / file (blind append), with the relative path of a file, each time a file is written. Preferably terminated by a \0 for use with traditional shell automation ( | xargs -0 ... )
Andrew Bartlett
2021-Nov-24 17:43 UTC
[Samba] samba 4.13: backup script: FileNotFoundError
On Mon, 2021-11-22 at 22:23 +1300, Andrew Bartlett via samba wrote:> > Assuming that I set my DFS up correctly I think the cause is that > > 'netlogon' > > is a dangling link: > > $ ls -l /var/lib/samba/dfs/netlogon > > lrwxrwxrwx 1 root root 43 Mar 26 2021 /var/lib/samba/dfs/netlogon > > -> > > msdfs:dc0\netlogon,dc1\netlogon > > Should the directory backup script handle this case or should I > > move > > the [dfs] > > share? > > > Ideally it would handle this case. This regression was triggered by > a > > fix for issues with hard links.Please file a bug on this issue so we can remember it. Andrew Bartlett -- Andrew Bartlett (he/him) https://samba.org/~abartlet/ Samba Team Member (since 2001) https://samba.org Samba Team Lead, Catalyst IT https://catalyst.net.nz/services/samba Samba Development and Support, Catalyst IT - Expert Open Source Solutions