CUPS "add printer" cmd won't run from script? How to debug?

Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
Webtest
Level 4
Level 4
Posts: 375
Joined: Sun Feb 21, 2010 4:45 pm
Location: Carlisle, Pennsylvania, USA

CUPS "add printer" cmd won't run from script? How to debug?

Post by Webtest »

Esteemed Forum Participants and Lurkers:
========================================
Mint 15 32-bit Mate Locked LiveUSB system. Semi-Newbie alert!

I have had prelimiary success using a post by [url=http://forums.linuxmint.com/memberlist.php?mode=viewprofile&u=101516]lakona[/url] with a [url=http://forums.linuxmint.com/viewtopic.php?f=51&t=124242]"How To" for installing a Brother MFC-7360N printer on a LAN[/url] on a Linux system.

I can successfully install the printer from a terminal session, but one CUPS command (section 3.) fails to perform properly from the script that I am trying to write:

Code: Select all

#!/bin/sh
# 1. Change directory to the one containing the driver packages
cd /media/mint/linux-ext2/linux-brother-printer
# 2. Install the Brother MFC7360N driver packages
sudo dpkg -i --force-all mfc7360nlpr-2.1.0-1.i386.deb
sudo dpkg -i --force-all cupswrapperMFC7360N-2.0.4-2.i386.deb
# 3. Add the printer with CUPS command line  <-- Have prefixed cmd with "sudo" - same results
lpadmin -p MFC7360N -v lpd://BRN001BA99EEABB.local/queue -E
# 4. Show the printer status = device for MFC7360N: lpd://BRN001BA99EEABB.local/queue
lpstat -t | grep lpd://
The entire process runs fine when I enter the commands in either a mint user or a superuser terminal session, but when I run the script right after booting, the drivers install fine and it looks like the printer is added. However, if I try to print a LibreOffice (or any?) document, the print job is set up in the queue, but it just sits there and never prints. While this job is in the queue, if I execute:

Code: Select all

lpadmin -p MFC7360N -v lpd://BRN001BA99EEABB.local/queue -E
in either a mint user or superuser terminal session, the job that was 'stuck' in the queue prints in just a few seconds indicating that the printer is now active on the system.

The totally perplexing question is "why won't the lpadmin command run properly from the script?"

I certainly would appreciate any and all comments, suggestions, and assistance with this annoying problem.
Blessings in abundance, all the best, & ENJOY!
Art in Carlisle, PA USA
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
BOAT - a hole in the water that you pour money into
LINUX - a hole in your life that you pour TIME into

HP dx2400 Core 2 Duo 8 GB. Mint 13/15/17.x/18.x Mate <on LOCKED SD cards, and Kanguru USB drives> No Hard Drive / No SSD
User avatar
Webtest
Level 4
Level 4
Posts: 375
Joined: Sun Feb 21, 2010 4:45 pm
Location: Carlisle, Pennsylvania, USA

Re: CUPS "add printer" cmd won't run from script? What's wro

Post by Webtest »

I have done some more work on this, both on Mint 13 and 15 ... if I run my script, and then issue a print job (which hangs in the queue) ... and then if I issue another separate script that just has the CUPS "add printer" line which is issued a second time, the printer will activate and the job will print. So, it's not that the command will not run at all from a script.

If I add more to the original script to delay about 10 seconds, and then issue the "add printer" command a second time, when I try to print a job the printer just spits out page after page of blank paper! This is totally unacceptable.

So, there doesn't appear to be any way to automatically install the Brother printer. Yuk.

I would sincerely appreciate any and all comments, suggestions, and assistance.
Blessings in abundance, all the best, & ENJOY!
Art in Carlisle, PA USA
BOAT - a hole in the water that you pour money into
LINUX - a hole in your life that you pour TIME into

HP dx2400 Core 2 Duo 8 GB. Mint 13/15/17.x/18.x Mate <on LOCKED SD cards, and Kanguru USB drives> No Hard Drive / No SSD
Locked

Return to “Printers & Scanners”