On Thu, July 23, 2020 15:56, Andrew Bartlett wrote:> > Clearly there is, as otherwise we could not be in waitpid on it. > The process is not a python process, it will be tdbbackup. The > command line arguments to that process will be instructive.Here it is: root 36800 0.8 0.0 12556 2788 1 SJ 16:49 0:00.01 /usr/local/bin/tdbbackup -s .copy.tdb /var/db/samba4/private/secrets.ldb -- *** e-Mail is NOT a SECURE channel *** Do NOT transmit sensitive data via e-Mail Unencrypted messages have no legal claim to privacy Do NOT open attachments nor follow links sent by e-Mail James B. Byrne mailto:ByrneJB at Harte-Lyne.ca Harte & Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3
On Thu, 2020-07-23 at 16:54 -0400, James B. Byrne via samba wrote:> > On Thu, July 23, 2020 15:56, Andrew Bartlett wrote: > > > > Clearly there is, as otherwise we could not be in waitpid on it. > > The process is not a python process, it will be tdbbackup. The > > command line arguments to that process will be instructive. > > Here it is: > > root 36800 0.8 0.0 12556 2788 1 SJ 16:49 0:00.01 > /usr/local/bin/tdbbackup -s .copy.tdb > /var/db/samba4/private/secrets.ldbAnd, using whatever FreeBSD replaces lslocks with, is blocking that? Does this still fail with Samba stopped? Andrew Bartlett -- Andrew Bartlett https://samba.org/~abartlet/ Authentication Developer, Samba Team https://samba.org Samba Developer, Catalyst IT https://catalyst.net.nz/services/samba
On Thu, July 23, 2020 16:54, James B. Byrne wrote:> > > On Thu, July 23, 2020 15:56, Andrew Bartlett wrote: >> >> Clearly there is, as otherwise we could not be in waitpid on it. >> The process is not a python process, it will be tdbbackup. The >> command line arguments to that process will be instructive. >Run from the command line it succeeds and returns nearly immediately: [root at smb4-2 ~ (master)]# time /usr/local/bin/tdbbackup -v -s .copy.tdb /var/db/samba4/private/secrets.ldb /var/db/samba4/private/secrets.ldb : 11 records real 0m0.003s user 0m0.002s sys 0m0.001s [root at smb4-2 ~ (master)]# echo $? 0 [root at smb4-2 ~ (master)]# ll /var/db/samba4/private/secrets*.copy* -rw------- 1 root wheel 40172 Jul 23 16:49 /var/db/samba4/private/secrets.ldb.copy.tdb.tmp -- *** e-Mail is NOT a SECURE channel *** Do NOT transmit sensitive data via e-Mail Unencrypted messages have no legal claim to privacy Do NOT open attachments nor follow links sent by e-Mail James B. Byrne mailto:ByrneJB at Harte-Lyne.ca Harte & Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3
On Thu, July 23, 2020 17:02, Andrew Bartlett wrote:> >> >> root 36800 0.8 0.0 12556 2788 1 SJ 16:49 0:00.01 >> /usr/local/bin/tdbbackup -s .copy.tdb >> /var/db/samba4/private/secrets.ldb > > And, using whatever FreeBSD replaces lslocks with, is blocking that?I am not aware of what information lslocks provides. However, the following may be useful: File "/usr/local/lib/python3.7/site-packages/samba/netcmd/domain_backup.py", line 924, in offline_tdb_copy tdb.open(path) A transaction is still active in ldb context [0x800a9c6a0] on /var/db/samba4/private/secrets.ldb [root at smb4-2 ~ (master)]# lsof -p 57982 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME tdbbackup 57982 root cwd VDIR 1879478894,3590381084 63 14 /zroot/iocage/jails/smb4-2/root -- root . . . tdbbackup 57982 root 3u VREG 1879478894,3590381084 1286144 256159 /zroot/iocage/jails/smb4-2/root -- var/db/samba4/private/secrets.ldb tdbbackup 57982 root 4u VREG 1879478894,3590381084 40172 200076 /zroot/iocage/jails/smb4-2/root (zroot/iocage/jails/smb4-2/root) The u after the file number (3u) indicates that the file is locked for update. fstat provides this [root at smb4-2 ~ (master)]# fstat -p 57982 USER CMD PID FD MOUNT INUM MODE SZ|DV R/W root tdbbackup 57982 text / 205969 -rwxr-xr-x 19472 r root tdbbackup 57982 ctty [restricted] 755 crw--w---- pts/5 rw root tdbbackup 57982 wd / 14 drwxr-xr-x 63 r root tdbbackup 57982 root / 4 drwxr-xr-x 22 r root tdbbackup 57982 jail / 4 drwxr-xr-x 22 r root tdbbackup 57982 0 [restricted] 755 crw--w---- pts/5 rw root tdbbackup 57982 1 [restricted] 755 crw--w---- pts/5 rw root tdbbackup 57982 2 [restricted] 755 crw--w---- pts/5 rw root tdbbackup 57982 3 / 256159 -rw------- 1286144 rw root tdbbackup 57982 4 / 200076 -rw------- 40172 rw> > Does this still fail with Samba stopped? >Yes. Online and offline backups both fail. Offline gives no indication of what it is waiting on and neither does tdbbackup. Online fails trying to attach to nbt ports. Under separate cover I have sent you the output from dtruss run with both the locked and unlocked runs of tdbbackup. The unlocked run completes. The locked run hangs. -- *** e-Mail is NOT a SECURE channel *** Do NOT transmit sensitive data via e-Mail Unencrypted messages have no legal claim to privacy Do NOT open attachments nor follow links sent by e-Mail James B. Byrne mailto:ByrneJB at Harte-Lyne.ca Harte & Lyne Limited http://www.harte-lyne.ca 9 Brockley Drive vox: +1 905 561 1241 Hamilton, Ontario fax: +1 905 561 0757 Canada L8E 3C3