[Samba] "samba-tool backup offline" stuck

Andrew Bartlett abartlet at samba.org
Thu Nov 21 17:20:25 UTC 2019


On Thu, 2019-11-21 at 14:58 +0100, Andrea Venturoli wrote:
> On 2019-11-13 13:11, Andrea Venturoli wrote:
> 
> > I'm open to suggestions...
> 
> Some further step...
> 
> It's samba-tool itself that locks the file before calling tdbbackup.
> 
> Running "samba-tool domain backup offline ..." spawns "tdbbackup -s 
> .copy.tdb /var/db/samba4/private/secrets.ldb -r", which gets stuck.
> 
> Running "tdbbackup -s .copy.tdb /var/db/samba4/private/secrets.ldb -r" 
> by itself completes without issues.
> 
> 
> 
> I read in domain_backup.py:
> 
> >     # Secrets databases are a special case: a transaction must be started                                                                                                                                                                     
> >     # on the secrets.ldb file before backing up that file and secrets.tdb                                                                                                                                                                     
> >     def backup_secrets(self, private_dir, lp, logger):
> >         secrets_path = os.path.join(private_dir, 'secrets')
> >         secrets_obj = Ldb(secrets_path + '.ldb', lp=lp)
> >         logger.info('Starting transaction on ' + secrets_path)
> >         secrets_obj.transaction_start()
> >         self.offline_tdb_copy(secrets_path + '.ldb')
> >         self.offline_tdb_copy(secrets_path + '.tdb')
> >         secrets_obj.transaction_cancel()
> 
> Could the problem be here?
> I'm not attempting to alter this, before understanding it fully, though.

Is tdbbackup the one provided by the Samba build, or an earlier
(system) version?

We had to change the lock behaviour in tdb to make this work, if you
ran an older version it would do as you note. 

Andrew Bartlett
-- 
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba





More information about the samba mailing list