[Samba] bsd printing and samba 4.17

Piviul piviul at riminilug.it
Tue Jan 9 09:18:36 UTC 2024


Hi all, I have a problem after upgrading samba from 4.14 to 4.17; the 
problem concern bsd printing. I have some bsd virtual printers 
configured to run a script that convert in pdf the printing and classify 
the document printed. When I print all seems to works except that the 
document printed is not removed from the spool an locks further printing.

I have created a similar printing server with this smb.conf:

> [global]
>     log file = /var/log/samba/log.%m
>     logging = file
>     map to guest = Bad User
>     max log size = 1000
>     obey pam restrictions = Yes
>     pam password change = Yes
>     panic action = /usr/share/samba/panic-action %d
>     printcap name = /etc/printcap
>     realm = AD.CSARICERCHE.COM
>     security = ADS
>     server min protocol = NT1
>     server string = %h server
>     template shell = /bin/bash
>     usershare allow guests = Yes
>     winbind refresh tickets = Yes
>     workgroup = DOMINIOCSA
>     idmap config dominiocsa : range = 10000-24999
>     idmap config dominiocsa : backend = rid
>     idmap config * : range = 3000-9999
>     idmap config * : backend = tdb
>     printing = bsd
>
>
> [printers]
>     browseable = No
>     comment = All Printers
>     path = /var/tmp
>     printable = Yes
>
>
> [print$]
>     comment = Printer Drivers
>     path = /var/lib/samba/printers
>     write list = "@DOMINIOCSA\domain admins"
>
>
> [testBSD]
>     comment = Stampante di test per debug parametri
>     lpq command =
>     path = /tmp
>     printable = Yes
>     print command = /opt/scripts/bin/testBSD.sh "s: %s" "S: %S" "m: 
> %m" "M: %M" "I: %I" "J: %J" "p: %p" "D: %D"

the print command is:

> # cat /opt/scripts/bin/testBSD.sh
> #!/bin/bash
>
> user_name=$(whoami | sed 's/^DOMINIOCSA\\//')
> user_home=/home/DOMINIOCSA/$user_name
>
> Filelog=$user_home/.$(basename "$0" .sh).log
> echo "" >> $Filelog
> echo "-----------------------------------------------" >> $Filelog
> echo $(date +"%d/%m/%Y %H:%M:%S") >> $Filelog
>
> i=0
> while [ $i -lt $# ]; do
>     i=$(($i+1))
>     echo \\\$$i: $(eval "echo \$$i") >> $Filelog
> done

just for a test purpose. Well, when a user print on the testBSD.log I 
can find:

> -----------------------------------------------
> 09/01/2024 09:49:40
> \$1: s: smbprn.WLIDnn
> \$2: S: testBSD
> \$3: m: win10pro-v01
> \$4: M:
> \$5: I: 0.0.0.0
> \$6: J: Pagina di prova
> \$7: p: testBSD
> \$8: D: DOMINIOCSA

As you can see all seems to works except that the document printed is 
not automatically removed from the spool, and as I already say, remain 
in queue and lock further documents printing.

On the logs I can't find nothing relevant but if you need something 
please let me know.

Piviul





More information about the samba mailing list