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

Forum rules
Before you post please read this

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

Postby Webtest on Wed Nov 06, 2013 2:28 pm

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 lakona with a "How To" for installing a Brother MFC-7360N printer on a LAN 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 Webtest on Wed Nov 13, 2013 3:04 pm, edited 1 time in total.
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 4 GB - Mint 10 Gnome, Mint 13 Mate, Mint 15 Mate <on LOCKED Kanguru USB drives>
Webtest
Level 3
Level 3
 
Posts: 184
Joined: Sun Feb 21, 2010 4:45 pm
Location: Carlisle, Pennsylvania, USA

Linux Mint is funded by ads and donations.
 

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

Postby Webtest on Wed Nov 13, 2013 3:03 pm

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 4 GB - Mint 10 Gnome, Mint 13 Mate, Mint 15 Mate <on LOCKED Kanguru USB drives>
Webtest
Level 3
Level 3
 
Posts: 184
Joined: Sun Feb 21, 2010 4:45 pm
Location: Carlisle, Pennsylvania, USA


Return to Printers & Scanners

Who is online

Users browsing this forum: No registered users and 2 guests