History: Ubuntu 10.04
After downloading and installing the driver for my new Lexmark Prospect Pro 205 printer/fax/scanner/copier from Lexmark’s support pages, by unpacking it and doing
it tested fine by printing a test page. However, printing from an application like LibreOffice Write, or any other application for that matter, just resulted in an error and not printout.
The problem may be seen without going to the command line by simply right-clicking the stopped printqueue item and viewing the detail. The status from the printer is: “/usr/lexinkjet/lxk09/bin/printdriver failed” (or some other file like in that bin directory)
The log at /var/log/cups/error_log shows:
D [11/May/2011:14:50:51 +0200] [Job 32] envp="DEVICE_URI=lxusb://Lexmark/Pro200-S500%20Series" D [11/May/2011:14:50:51 +0200] [Job 32] envp="PRINTER_INFO=Lexmark Pro205 via USB" D [11/May/2011:14:50:51 +0200] [Job 32] envp="PRINTER_LOCATION=" D [11/May/2011:14:50:51 +0200] [Job 32] envp="PRINTER=Lexmark_Pro205_USB" D [11/May/2011:14:50:51 +0200] [Job 32] envp="CUPS_FILETYPE=document" D [11/May/2011:14:50:51 +0200] [Job 32] envp="FINAL_CONTENT_TYPE=printer/Lexmark_Pro205_USB" D [11/May/2011:14:50:51 +0200] [Job 32] Started filter /usr/lib/cups/filter/pdftopdf (PID 15284) D [11/May/2011:14:50:51 +0200] [Job 32] Started filter /usr/lib/cups/filter/pdftoraster (PID 15285) D [11/May/2011:14:50:51 +0200] [Job 32] Started filter /usr/lexinkjet/lxk09/bin/printdriver (PID 15286) D [11/May/2011:14:50:51 +0200] [Job 32] Started backend /usr/lib/cups/backend/lxusb (PID 15287) D [11/May/2011:14:50:51 +0200] [Job 32] /usr/lexinkjet/lxk09/bin/printdriver: Permission denied D [11/May/2011:14:50:51 +0200] [Job 32] STATE: +connecting-to-device D [11/May/2011:14:50:51 +0200] [Job 32] Printer using device file "/dev/usblp0"... D [11/May/2011:14:50:51 +0200] [Job 32] STATE: -connecting-to-device D [11/May/2011:14:50:51 +0200] [Job 32] backendRunLoop(print_fd=0, device_fd=5, use_bc=1) D [11/May/2011:14:50:51 +0200] [Job 32] Ghostscript command line: /usr/bin/gs -dQUIET -dPARANOIDSAFER -dNOPAUSE -dBATCH -sDEVICE=cups -sstdout=%stderr -sOutputFile=%stdout -I/usr/share/cups/fonts -sOutputType=1 -r300x300 -dDEVICEWIDTHPOINTS=595 -dDEVICEHEIGHTPOINTS=841 -dcupsMediaType=1 -dcupsBitsPerColor=8 -dcupsColorOrder=0 -dcupsColorSpace=1 -dcupsCompression=8 -dcupsRowFeed=1 -dcupsRowStep=1 -scupsPageSizeName=A4 -c -f -_ (I highlighted the pertinent line above)
However, I found this line in /var/log/messages:
May 12 08:56:24 gts-server kernel: [214361.584639] type=1400 audit(1305183384.387:59): apparmor="DENIED" operation="exec" parent=15270 profile="/usr/sbin/cupsd" name="/usr/local/lexmark/lxk09/bin/printdriver" pid=28978 comm="cupsd" requested_mask="x" denied_mask="x" fsuid=7 ouid=0
This indicated that something call apparmor denies access to the printdriver file.
Reading up on this, I found that apparmor has a profile that protects CUPS by default in Ubuntu. All one has to do to make printing work, is to tell apparmor where the Lexmark driver is and allow it to run.
This is what I changed in /etc/apparmor.d/usr.sbin.cupsd
# backends which come with CUPS can be confined /usr/lib/cups/backend/bluetooth ixr, /usr/lib/cups/backend/dnssd ixr, /usr/lib/cups/backend/http ixr, /usr/lib/cups/backend/ipp ixr, /usr/lib/cups/backend/lpd ixr, /usr/lib/cups/backend/parallel ixr, /usr/lib/cups/backend/scsi ixr, /usr/lib/cups/backend/serial ixr, /usr/lib/cups/backend/snmp ixr, /usr/lib/cups/backend/socket ixr, /usr/lib/cups/backend/usb ixr, /usr/lib/cups/backend/lxnet ixr, # we treat cups-pdf specially, since it needs to write into /home # and thus needs extra paranoia /usr/lib/cups/backend/cups-pdf Px, # third party backends get no restrictions as they often need high # privileges and this is beyond our control /usr/lib/cups/backend/* Ux, /usr/lib/cups/cgi-bin/* ixr, /usr/lib/cups/daemon/* ixr, /usr/lib/cups/monitor/* ixr, /usr/lib/cups/notifier/* ixr, # filters and drivers (PPD generators) are always run as non-root, # and there are a lot of third-party drivers which we cannot predict # Lexmark Pro205 driver /usr/local/lexmark/lxk09/* rix, /usr/local/lexmark/lxk09/lib/* rix, /usr/local/lexmark/lxk09/bin/* rix, /usr/lexinkjet/lxk09/* rix,
(Again, I have marked the additions in red)
After restarting apparmor (sudo /etc/init.d/apparmor restart) the printer prints with both the USB and Wifi connections as it should.
The scanner also work 100% with the simplescan sane frontend, but only via the USB cable, not via wifi.
Faxing from the computer I haven’t addressed yet, since the print driver doesn’t expose the fax function.
Tom Bamford added this comment on the glug-tech(at)linux(dot)org(dot)za list:
AppArmor often gives me hassle when I’m working with files in arbitrary locations.
You can edit /etc/apparmor.d/usr.sbin.cupsd and add the path to the printdriver binary (/usr/local/lexmark/lxk09/bin/printdriver) under the existing entries for /usr/sbin/* etc. Or (less ideally) just put the cupsd profile into complain mode.
Trouble with the legacy-1.0-1 driver
When attempting to install the lexmark-inkjet-legacy-1.0-1.i386.deb.sh driver from Lexmark and lua error occurs. Lexmark support has send me this advice.
- Please delete the tmp folder that was created after extracting the shell script.
- Extract the shell file (the extracted file)
sudo sh –keep –noexec . This will create the tmp folder
- Edit run.lua found in /tmp/config/run.lua. Change ownhership to ownership.
- Go back to terminal and type cd ..
- Then type sudo sh startupinstaller.sh
It seems that this problem was reported here more than a year ago, but the driver has not been updated by Lexmark since. Please message them and ask them to fix the simple mistake now!
Installing these three drivers allows printing and scanning via USB of WIFI from Ubuntu. Very nice!
Unfortunately I noticed today (18 Mar 2013) that Lexmark have removed these from their support site!
Ubuntu 12.04 & 12.10
These drivers (above) did allow printing with Ubuntu , but not network scanning with Ubuntu 12.04 & 12.10.
It now seems that there is only support for Fedora 10 and OpenSuse 11.0 / 11.1 from Lexmark.
Are they working of fixing the bugs for Debian based distros? No-one knows, since they’re denying everything (head in the sand, hoping it will go away?)
I have downloaded the Fedora driver and with see if I can hack to work on Ubuntu 12.04 / 12.10 and report back if I succeed.