Showing posts with label CUPS. Show all posts
Showing posts with label CUPS. Show all posts

17/03/2010

How to stop CUPS from asking for the root password

CUPS has a quite restrictive allow/deny policy. Cancelling jobs requires the owner or root (OK, makes sense), for starting and stopping printers you also need root privileges. My root password is befittingly cumbersome, so I looked for some kind of CUPS sudo.
The file to look for is /etc/cups/cupsd.conf, which can be conveniently edited from the CUPS web interface's (localhost:631) Administration tab.

16/10/2008

Security bugfix in CUPS 1.3.9

Once again according to Heise, CUPS 1.3.9 fixes some possible exploits, so I was a bit miffed to find nothing more recent than 1.2.12 in the openSuSE main repos (on 10.3, at least).
However, CUPS 1.3.9 is available from the openSuSE Printing repo.

08/10/2008

Network print on a Windows machine

Here is the howto for connecting to a Windows printer from Linux

Prerequisites: installed samba (maybe samba-client is sufficient), cups, ghostscript, foomatic-filters (most of them are default anyway), the printer must be shared and accessible over the network.

  1. Open a browser of your choice and type localhost:631 into the address bar
  2. Click "Add printer" and fill name, location and description and continue
  3. For device choose "Windows Printer via SAMBA"
  4. Device-URI: smb://<windowsboxname>/<printersharename> - no port required, so leave it empty
  5. Choose the model of the printer - if the driver is not in the database you'll have to provide the ppd-file.
  6. At around this point you'll be asked for user name and password for CUPS (most likely, your root password, depending on your configuration)
  7. Change options if neccessary and enjoy

01/07/2008

Brother DCP-7010, openSuSE 10.3 and openSuSE 11

Ok, so I got the nice scanner-printer-copymachine-combo named DCP-7010 from Brother. Just some small things to mention:

  1. Printer Driver installation using the CUPS-Wrapper system went smooth following the description given by the brother people, i.e.

  2. Scanner Driver installation also went smooth:

    Xsane instantly could work with the scanner (I'm impressed - not necessarily because of the scanner - it is good for black/white and grey scans, not really good for colours - but because of the smooth installation)
  3. The BrKey tool enabling the support for the hardware "Scan-to-Email", "Scan-to-File", "Scan-to-Image" and "Scan-to-text" keys also worked buuuuuut: the fine tuning might be a little tricky, so here are some hints how to optimize your workflow:

Each of those "scanning options" simply invokes a script which does the work. You can find the scripts in the folder
/usr/local/Brother/sane/script
if you want to edit them, be sudo, if you want to work with them, be a normal user.

Change the resolution to your needs. I also wanted to change the scan length (in standard, it is obviously set to be 35cm, which is a little too much for normal A4 or letter...)
you can achieve that by adding the option -y 298.00 to the "scanimage" command. I furthermore wanted to have the scan not in 24bit color, but in b/w and wanted to get a pdf file out of it. Don't use the line brother suggests. For me the following script worked, so I'll just copy it here - I think most of it is self-explaining. BTW: with scanimage --help you can get the specific driver options for the brother as well, if you want to fiddle around more (but - Black & White seems to be just "Black", at least it worked for my model)


#! /bin/sh
set +o noclobber
#
# $1 = scanner device
# $2 = friendly name
#

#
# 100,200,300,400,600
#
resolution=400
device=$1
mkdir -p ~/brscan
if [ "`which usleep`" != '' ];then
usleep 10000
else
sleep 0.01
fi
output_file=`mktemp ~/brscan/brscan.XXXXXX`
chmod 644 $output_file
echo "scan from $2($device) to $output_file"
# ================================================
# here is the actual scan command:
scanimage --device-name "$device" --mode Black \
--resolution $resolution \
-y 298.00 \
|pnmtops > "$output_file".ps
ps2pdfwr "$output_file".ps "$output_file".pdf
# delete temporary files
rm "$output_file".ps
rm "$output_file"



All documents scanned will show up in a folder named brscan in your home directory.

Just to mention: since there are four scripts, you might want to have actually different "scan-to-file" settings on the other positions (scan-to-email, scan-to-picture, scan-to-ocr). Which scripts are started with each setting of the scan key is set up in the file
/usr/local/Brother/sane/brscan-key-versionnumber.cfg.
Just edit it to your needs. Have a lot of fun ;-) - and by the way: the DCP-7010 is really a good model, if you want to have a quite good laser printer and copier and no space on your desk for an additional scanner.

Update:
The same procedure works for a MFC-7820N (connected via USB) on Ubuntu 9.10 and 10.10. Follow the instructions on http://welcome.solutions.brother.com/ - you'll need to put /usr/bin/brscan-skey in the Autostart for every user who shall be able to use the scan key options. With the script above, unfortunately, the Automatic Document Feeder (ADF) doesn't work. You can however use it with Xsane: you'll just have to put the number of pages you want to scan in the upper left corner of the main field of Xsane.

2nd Update: 
The Automatic Document Feeder (ADF) actually works with a slightly modified script, as has been posted here.

09/11/2007

CUPS in openSUSE 10.3 doesn't like Brothers - the solution: CUPS 1.3.4

Trying to use CUPS for my beloved Brother Laserprinter HL-1440 (yes I know, old model, but still very useable and at least some drivers for Linux available) on Thukydides (Samsung P35 XVM 1600 II) is obviously tricky.

First, the installed CUPS wasn't running properly, since the url http://localhost:631 typed into Konqueror and Firefox only showed an "Error 404". So I decided to reinstall it (i.e. choose right-click and then "force reinstall" for all CUPS packages) which after a reboot worked pretty well and instantly found my Brother HL-1440 and made it available.

But there are still problems: one (and the most severe one) the first job is printed fine, but after the first job, CUPS doesn't print any following job and says "Printer not connected; will retry in 30 seconds...". Interestingly, giving an lsusb on a console still shows the printer connected. If I switch off the printer and switch it on again, CUPS is willing to send the following job from the queue to the printer and then again claims the printer not to be connected.

No solution found for the behaviour mentioned above yet - but in the log files of cups which you can find in /var/log/cups/ you'll find quite some errors, and the configuration file of cups /etc/cups/cupsd.conf is a mere mess in documentation - especially capital and non-capital letters seem to be messed up. Maybe this could be fixed sometimes, SUSE?

I found the solution in the bug database of www.cups.org: this problem is fixed since some version 1.3 so I decided to install the actual stable version 1.3.4. I mainly followed these steps I'll just document here

1. Download the tarball 1.3.4 from www.cups.org

2. build the rpm according to the hints given in the documentation - I used the command: sudo rpmbuild -ta cups-1.3.4-source.tar.gz --without php on a console. The rpms are created in /usr/src/packages/RPMS/i586/

3. Go into YaST and add the directory /usr/src/packages/RPMS/i586/ as "pure RPM directory" as installation source

4. Update the CUPS and ignore the dependencies for "CUPS client".

5. Restart the machine.

One thing I changed in the configuration file /etc/cups/cupsd.conf was to allow to stop and restart the printer without Authentication, otherwise the hotplug-system bitches in the cups-error log (which you can btw easily read out with the nice gui frontend called ksystemlogs):
sudo vi /etc/cups/cupsd.conf and add a section after the section
# All administration operations require an administrator to authenticate...
<Limit ... >
</Limit>

as follows

# The following stuff is switched, because the hotplug-system otherwise complains all the time about...
<Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer>
AuthType None
Order deny,allow
</Limit>

and remove the Pause-Printer Resume-Printer Enable-Printer Disable-Printer from the section administration operations.


A comment: obviously this "Brother printer not seen"-problem seems to be known, see the bug report here and here