[Samba] how to disable 'pcap cache not loaded' messages?

Georgy Fedorov gfedorov at unimelb.edu.au
Mon Jul 18 11:44:22 UTC 2016


Dear All,

We're running smbd "Version 4.3.9-Ubuntu", and it populates our log 
files with these two lines per every connect:

===
[2016/07/18 18:42:31.544726,  1] 
../source3/printing/printer_list.c:234(printer_list_get_last_refresh)
   Failed to fetch record!
[2016/07/18 18:42:31.544780,  1] 
../source3/smbd/server_reload.c:69(delete_and_reload_printers)
   pcap cache not loaded
===

I have tried various mantras to disable printing, e.g.
===
|load printers = no
printing = bsd
printcap name = /dev/null
disable spoolss = yes |
===

, but it keeps spamming the log files nevertheless.

 From what I see with strace, it looks like a default "printer_list.tdb" 
is created by smbd, and then printer_list_get_last_refresh() tries to 
get the last cache timestamp.
 From what I can see with tdbtool, the default db has no timestamp key, 
so printer_list_get_last_refresh() fails, and prints these messages.

See strace log fragment below.

===
[pid 31896] open("/var/run/samba/printer_list.tdb", O_RDWR|O_CREAT, 
0644) = 37
[pid 31896] fcntl(37, F_GETFD)          = 0
[pid 31896] fcntl(37, F_SETFD, FD_CLOEXEC) = 0
[pid 31896] fcntl(37, F_SETLKW, {l_type=F_WRLCK, l_whence=SEEK_SET, 
l_start=0, l_len=1}) = 0
[pid 31896] fcntl(37, F_SETLK, {l_type=F_WRLCK, l_whence=SEEK_SET, 
l_start=4, l_len=1}) = 0
[pid 31896] fcntl(37, F_SETLKW, {l_type=F_WRLCK, l_whence=SEEK_SET, 
l_start=168, l_len=0}) = 0
[pid 31896] lseek(37, 0, SEEK_SET)      = 0
[pid 31896] ftruncate(37, 0)            = 0
[pid 31896] write(37, "TDB 
file\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 696) = 696
[pid 31896] fcntl(37, F_SETLKW, {l_type=F_UNLCK, l_whence=SEEK_SET, 
l_start=168, l_len=0}) = 0
[pid 31896] lseek(37, 0, SEEK_SET)      = 0
[pid 31896] read(37, "TDB 
file\n\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 168) = 168
[pid 31896] fstat(37, {st_mode=S_IFREG|0644, st_size=696, ...}) = 0
[pid 31896] fstat(37, {st_mode=S_IFREG|0644, st_size=696, ...}) = 0
[pid 31896] mmap(NULL, 696, PROT_READ|PROT_WRITE, MAP_SHARED, 37, 0) = 
0x7fab5ba88000
[pid 31896] fcntl(37, F_SETLKW, {l_type=F_UNLCK, l_whence=SEEK_SET, 
l_start=4, l_len=1}) = 0
[pid 31896] fcntl(37, F_SETLKW, {l_type=F_RDLCK, l_whence=SEEK_SET, 
l_start=4, l_len=1}) = 0
[pid 31896] fcntl(37, F_SETLKW, {l_type=F_UNLCK, l_whence=SEEK_SET, 
l_start=0, l_len=1}) = 0
[pid 31896] fstat(37, {st_mode=S_IFREG|0644, st_size=696, ...}) = 0
[pid 31896] fcntl(37, F_SETLKW, {l_type=F_RDLCK, l_whence=SEEK_SET, 
l_start=628, l_len=1}) = 0
[pid 31896] fcntl(37, F_SETLKW, {l_type=F_UNLCK, l_whence=SEEK_SET, 
l_start=628, l_len=1}) = 0
[pid 31896] stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2223, 
...}) = 0
[pid 31896] geteuid()                   = 0
[pid 31896] fstat(33, {st_mode=S_IFREG|0644, st_size=4878, ...}) = 0
[pid 31896] write(33, "[2016/07/18 20:48:22.671943,  1,"..., 114) = 114
[pid 31896] geteuid()                   = 0
[pid 31896] write(33, "  Failed to fetch record!\n", 26) = 26
[pid 31896] stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2223, 
...}) = 0
[pid 31896] geteuid()                   = 0
[pid 31896] write(33, "[2016/07/18 20:48:22.672296,  1,"..., 107) = 107
[pid 31896] geteuid()                   = 0
[pid 31896] write(33, "  pcap cache not loaded\n", 24) = 24
===

I tend to think that this happens unconditionally, so smb.conf doesn't 
really help.

I'm no samba expert, so I can't suggest a proper patch, but I reckon you 
shall either add the proper key by default, or at least raise debug 
level for these messages.
I'd be really grateful for a small piece of code that shows me how to 
create a proper timestamp record in "printer_list.tdb" and silence these 
messages for now.

I guess that might be a piece of a proper patch anyway.

Or if the patch is already there -- could one please point me in the 
right direction?

Kind regards, George

-- 
Note: since we are switching to Office365,
please do not hesitate to re-send me any e-mails
that were not answered for past three days,
since they might just have been lost in the transition process.

George Fedorov
Senior Systems Specialist
Melbourne School of Engineering
The University of Melbourne, Victoria 3010, Australia
phone: +61-(0)3-903-56016
email: gfedorov at unimelb.edu.au
http://www.eng.unimelb.edu.au/



More information about the samba mailing list