View Issue Details

IDProjectCategoryView StatusLast Update
0016355CentOS-7sambapublic2019-11-04 09:13
ReporterMikaku 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version7.6.1810 
Target VersionFixed in Version 
Summary0016355: Local printer script not working with the latest Samba update 4.8.3-6.el7_6
DescriptionHello,

With the recent Samba update I start seeing a lot of pending printer jobs in the queue, and I've found out that if I undo the last Samba update all printing jobs are working again.

I've a Samba printer share that executes the 'enscript' command to format a text plain listing and send the job to another Samba printer share to convert it to PDF (with 'ps2pdf').

This printer stop working right after updating the following packages:

samba-client-libs-4.8.3-4.el7.x86_64
samba-common-tools-4.8.3-4.el7.x86_64
samba-common-4.8.3-4.el7.noarch
samba-common-libs-4.8.3-4.el7.x86_64
samba-client-4.8.3-4.el7.x86_64
samba-libs-4.8.3-4.el7.x86_64
samba-4.8.3-4.el7.x86_64

dependencies:
libsmbclient-4.8.3-4.el7.x86_64
libwbclient-4.8.3-4.el7.x86_64
Steps To Reproduce1. Prepare an text/plain file that will be the listing to be converted to PDF.

2. Connect to printer to format the text/plain with 'enscript' and send it the file:
# smbclient //localhost/TXT2PDF_Printer -U felix
Enter XXXXXXXXXX\felix's password:
Try "help" to get a list of possible commands.
smb: \> put file.txt
putting file file.txt as \file.txt (8.7 kb/s) (average 8.7 kb/s)
smb: \> quit

3. Check printer spool to see the job stuck in queue:
# lpstat -t
scheduler is running
system default destination: lp
device for lp: smb://192.168.1.4/DM309
device for lp5: smb://localhost/TXT2PDF_Printer
device for lp7: smb://localhost/PDF_Printer
lp accepting requests since Tue 29 Jan 2019 04:20:01 PM CET
lp5 accepting requests since Tue 20 Aug 2019 08:52:50 AM CEST
lp7 accepting requests since Mon 26 Aug 2019 10:30:31 AM CEST
printer lp is idle. enabled since Tue 29 Jan 2019 04:20:01 PM CET -
printer lp5 is idle. enabled since Tue 20 Aug 2019 08:52:50 AM CEST
printer lp7 is idle. enabled since Mon 26 Aug 2019 10:30:31 AM CEST
lp7-76480 felix 13312 Mon 26 Aug 2019 10:30:31 AM CEST

As you can see, the job sent by lp5 (TXT2PDF_Printer) to lp7 (PDF_Printer) is stuck in queue.

Logs in /var/log/samba/*, /var/log/cups/*, /var/log/messages and /var/log/secure doesn't show any relevant information.
The only difference is in the log 'log.smbd' with the latest (faulty) Samba version, I see some missing lines when comparing with the same log using the working Samba version.
Additional Information# testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
[...]
Processing section "[PDF_Printer]"
Processing section "[TXT2PDF_Printer]"
Loaded services file OK.
WARNING: You have some share names that are longer than 12 characters.
These may not be accessible to some older clients.
(Eg. Windows9x, WindowsMe, and smbclient prior to Samba 3.0.)
Server role: ROLE_STANDALONE

Press enter to see a dump of your service definitions

# Global parameters
    dos charset = ISO8859-1
    interfaces = lo eno1
    log file = /var/log/samba/log.%m
    max log size = 50
    obey pam restrictions = Yes
    passdb backend = smbpasswd:/etc/samba/smbpasswd
    security = USER
    server string = Samba Server Version %v
    username map = /etc/samba/smbusers
    wins support = Yes
    workgroup = XXXXXXXXXX
    idmap config * : backend = tdb
    cups options = raw
    hosts allow = 127. 192.168.100.
    map archive = No
    nt acl support = No
    printing = bsd


[homes]
    browseable = No
    comment = Home Directories
    read only = No

[PDF_Printer]
    guest ok = Yes
    path = /tmp
    printable = Yes
    print command = /usr/local/bin/printpdf %s %u

[TXT2PDF_Printer]
    guest ok = Yes
    path = /tmp
    printable = Yes
    print command = /usr/local/bin/print_txt2pdf %s %u


# cat /usr/local/bin/printpdf
#!/bin/sh
DATE=`date +%b%d-%H%M%S`
FILE="/tmp/$DATE.pdf"

/usr/bin/ps2pdf14 -P -sPAPERSIZE=a4 $1 "$FILE"
rm -f $1


# cat /usr/local/bin/print_txt2pdf
#!/bin/sh
DATE=`date +%b%d-%H%M%S`
FILE="/tmp/$DATE.pdf"

/usr/bin/enscript --pretty-print=c --margins=:22:: --indent=0.5c --media=A4 --landscape --silent --no-job-header --no-header --font=Courier9 -P lp7 $1

rm -f $1


# lpstat -t
[root@linux /usr/local/bin]# lpstat -t
scheduler is running
system default destination: lp
device for lp: smb://192.168.1.4/DM309
device for lp5: smb://localhost/TXT2PDF_Printer
device for lp7: smb://localhost/PDF_Printer
TagsNo tags attached.
abrt_hash
URL

Activities

Mikaku

Mikaku

2019-11-04 09:13

reporter   ~0035635

According to 'Zathrus' user on freenode #centos
Oct 17 15:47:14 <Zathrus> Mikaku: you'll be waiting a long, long time on a response to that bug
Oct 17 15:48:38 <Zathrus> just that it's almost certainly not a centos bug, but an upstream one, and thus centos cannot do ANYTHING about it

Thanks to user 'moeSizlak' also on freenode #centos for the feedback:
Oct 17 16:00:33 <moeSizlak> well i opened a RHEL ticket Mikaku ill let you know what they say'
Oct 17 16:40:39 <moeSizlak> Mikaku, got a response from RedHat
Oct 17 16:40:47 <moeSizlak> The problem you describe is covered in the following Knowledgebase Solution: https://access.redhat.com/solutions/4401181
Oct 17 16:40:55 <moeSizlak> "Printing may not work with Samba 4.9.1 in RHEL 7.7"
Oct 17 16:41:25 <moeSizlak> While a permanent resolution is being investigated, please consider working around the issue by downgrading samba with a command like the following:
Oct 17 16:41:37 <moeSizlak> yum downgrade samba-4.8.3-4.el7.x86_64 ..... etc/....etc
Oct 17 16:41:44 <moeSizlak> LOL
Oct 17 16:42:05 <moeSizlak> Root Cause
Oct 17 16:42:05 <moeSizlak> The smbspool command in Samba 4.9.1 uses argv[0] to set the Device URI, but CUPS puts a "sanitized" URI in argv[0] when it calls smbspool. The result is that username/password information isn't passed to smbspool.

Conclusion:
1. No resolution from Red Hat yet.
2. Better stay with Samba 4.8.3-4.el7

Issue History

Date Modified Username Field Change
2019-08-26 09:03 Mikaku New Issue
2019-11-04 09:13 Mikaku Note Added: 0035635