[Samba] (/usr/lib64/cups/backend/smb) stopped with status 1

YuGiOhJCJ Mailing-List yugiohjcj-mailinglist at laposte.net
Wed Feb 7 20:08:45 UTC 2018


OK I finally found how to print with Samba (with both "smbclient" and "smbspool") and with CUPS.

Here is how to print with "smbclient":
$ smbclient //MyHiddenPC/MyHiddenShare -WMyHiddenDomain -c 'print my-hidden-file.pdf'.

Here is how to print with "smbspool":
$ export DEVICE_URI=smb://yugiohjcj:MyHiddenPassword@MyHiddenDomain/MyHiddenPC/MyHiddenShare
$ smbspool 1 1 Xerox-WorkCentre-5325-10 1 1 my-hidden-file.pdf
DEBUG: Connected with username/password...

Here is how to print with CUPS:
The trick seems to be to use the command line to add the printer because the username and password are not correctly added to the /etc/cups/printers.conf file if the CUPS web interface is used to add the printer.
After removing all the printers through the web interface, I added the printer through the command line:
$ sudo lpadmin -p Xerox-WorkCentre-5325 -v smb://yugiohjcj:MyHiddenPassword@MyHiddenDomain/MyHiddenPC/MyHiddenShare -P Xerox-WorkCentre_7345-pxlcolor.ppd
In /etc/cups/printers.conf, I can see the username and the password.
I also configured a minimal /etc/samba/smb.conf.
I configured the printer through the web interface to be sure that:
- It is set as the default printer
- It is accepting jobs (not refusing)
- It is resumed (not paused)
- Its media size is A4
- Its duplex mode is enabled on long edge
And it works!
I am able to print through CUPS.
I guess that some steps above are not necessary but I hope it could help someone in the same case than me.

Thanks a lot.
Problem fixed.

On Fri, 2 Feb 2018 15:33:22 +0100
YuGiOhJCJ Mailing-List <yugiohjcj-mailinglist at laposte.net> wrote:

> I tried at work to run "/usr/bin/smbspool" manually:
> ---
> $ /usr/bin/smbspool Xerox-WorkCentre-5325 \'5\' \'yugiohjcj\' \'2.pdf\' \'1\'
> DEBUG: Connected with username/password...
> ---
> 
> The behavior at work is different from the one at home because it is not the same computer used and the /etc/samba/smb.conf is available.
> However, as you can see above, the smbspool program is never closed!
> 
> I tried again to print through CUPS using the following command: lp my-hidden-file.pdf.
> This time, in the CUPS error_log file, I do not see that CUPS is trying to use /usr/lib64/cups/backend/smb as backend to print.
> That's weird.
> It seems to be using the IPP protocol instead of SMB.
> Indeed, I can find these lines in the error_log file:
> ---
> $ grep "//" error_log
> D [02/Feb/2018:10:35:56 +0100] Create-Job ipp://localhost:631/printers/Xerox-WorkCentre-5325
> D [02/Feb/2018:10:35:56 +0100] [Client 16] Returning IPP successful-ok for Create-Job (ipp://localhost:631/printers/Xerox-WorkCentre-5325) from localhost
> D [02/Feb/2018:10:35:56 +0100] Send-Document ipp://localhost:631/printers/Xerox-WorkCentre-5325
> D [02/Feb/2018:10:35:56 +0100] [Client 17] Returning IPP successful-ok for Send-Document (ipp://localhost:631/printers/Xerox-WorkCentre-5325) from localhost
> ---
> 
> I expected to have something similar to this:
> ---
> $ grep "//" error_log
> D [31/Jan/2018:09:35:36 +0100] Create-Job ipp://localhost:631/printers/Xerox-WorkCentre-5325
> D [31/Jan/2018:09:35:36 +0100] [Client 61] Returning IPP successful-ok for Create-Job (ipp://localhost:631/printers/Xerox-WorkCentre-5325) from localhost
> D [31/Jan/2018:09:35:36 +0100] Send-Document ipp://localhost:631/printers/Xerox-WorkCentre-5325
> D [31/Jan/2018:09:35:36 +0100] [Job 5] envp[24]="DEVICE_URI=smb://MyHiddenDomain/MyHiddenPC/MyHiddenShare"
> D [31/Jan/2018:09:35:36 +0100] [Client 62] Returning IPP successful-ok for Send-Document (ipp://localhost:631/printers/Xerox-WorkCentre-5325) from localhost
> D [31/Jan/2018:09:35:36 +0100] [Job 5] envp[24]=\"DEVICE_URI=smb://yugiohjcj:MyHiddenPassword@MyHiddenDomain/MyHiddenPC/MyHiddenShare\"
> ---
> 
> Why CUPS is not using the SMB protocol anymore to print please?
> 
> On Thu, 1 Feb 2018 12:47:18 +0100
> YuGiOhJCJ Mailing-List <yugiohjcj-mailinglist at laposte.net> wrote:
> 
> > Hello,
> > 
> > There is a printer at work (a Xerox WorkCentre 5325).
> > I am able to print using the following command: smbclient //MyHiddenPC/MyHiddenShare -WMyHiddenDomain -c 'print my-hidden-file.pdf'.
> > However, it does not work when I try to print through CUPS using the following command: lp my-hidden-file.pdf.
> > In the CUPS error_log file, the only error I can read is: [Job 5] PID 27883 (/usr/lib64/cups/backend/smb) stopped with status 1.
> > I am using samba-4.4.4 and cups-2.1.4 on the client side (Slackware64 14.2 operating system).
> > 
> > Any suggestion please?
> > 
> > I remarked that "ls -l /usr/lib64/cups/backend/smb" gives "/usr/bin/smbspool" as target.
> > When I run "/usr/bin/smbspool" manually with the same options than in the error_log file (/usr/bin/smbspool Xerox-WorkCentre-5325 \'5\' \'yugiohjcj\' \'2.pdf\' \'1\') I get status 1 and this error message: "ERROR: Can't load /etc/samba/smb.conf - run testparm to debug it".
> > Indeed, /etc/samba/smb.conf is missing (I thought it was not mandatory for the client part).
> > Creating the /etc/samba/smb.conf file seems to be the solution.
> > Well, I will try that at work.
> > 
> > I have three questions:
> > 1) Do you know which PPD file is used when I am printing with the smbclient command? (I have not specified any PPD file through this command line so I am wondering how it works)
> > 2) It seems that the password stored in /etc/cups/printers.conf is sent through network in the device URI using the smb protocol. So, is it encrypted or anyone can see it?
> > 3) When I go to localhost:631 to add the printer I give the full URI: smb://yugiohjcj:MyHiddenPassword@MyHiddenDomain/MyHiddenPC/MyHiddenShare but when I look in the /etc/cups/printers.conf file I only see this: smb://MyHiddenDomain/MyHiddenPC/MyHiddenShare. Why the username and password are not here please?
> > 
> > Thank you.
> > Best regards.



More information about the samba mailing list