### couple of questions regarding printing on Linux, pls

From Sony Lloyd

Answered By Ben Okopnik, Heather Stern, Kapil Hari Paranjape

Sorry to distrurb

> [Ben] Do not disturb sleeping dragons, for you are crunchy and good with ketchup. This is The Answer Gang - we _like being "disturbed" (several of us here could be described as having that attribute permanently set...) - at least if you pose an interesting question. So, fear not but approach our saurine majesties, small human creature.

> (Anybody seen that BBQ sauce bottle?)

> [Heather] No, but I think I saw a pizza heading into the hoard room.

I would have couple of questions regarding printing on Linux, pls: (1) I see "lpd" loading at my system boot up, but my kernel is not compiled with support for "lp" (confirmed by absence of "lp" from outputs of "cat `/proc/devices`").

> [Ben] "`/proc/devices`" does not necessarily reflect whether you have parallel port support available or not; in fact, mine does not contain an "lp" entry after startup, and yet I can happily print via my parallel port. The thing that makes the difference (and loads the modules as necessary) is the "kmod" option in the kernel: my "lp" module will be automatically loaded whenever I need it. Until then, "`/proc/devices`" will not have it listed.

How come lpd loads without linux being set for printing + with lp ports not detected by linux?

> [Ben] "lpd" is a piece of software that "catches" and outputs print jobs; that's all it does. If it is linked in your "`/etc/rc*d`" directories, it will load on startup. It does not care whether you've set up a parallel port or not; it just does what it's been told to do, which is start. If you have not configured the system corectly, and try to _use "lpd", it will log an error message - just as it should.

> One of the major differences between Wind0ws and Unix is that, rather than large monolithic programs that do many things at once (the Wind0ws way), Unix uses "small sharp tools" - programs that do one thing well and can be easily connected to other programs. In this philosophy, a printing daemon does not (and should not) check for the presence or absence of ports on startup - that's not its job. What if, for example, I decide not to load the "lp" module until I want to print? Should "lpd" fail to load?

(2)I have an old linux 2.0.30 with no xwindow.

> [Ben] The 2.0 kernels are perfectly capable of supporting XFree86. In fact, that's a bit of a misnomer: X only has a tangential relationship with the kernel - there's nothing in the kernel (as far as I know, anyway) that is required specifically for running it.

> [Heather] Yes, there is; the feature is called "sockets". But, if you disable it there are a lot of things that won't work.

> Depending on how much your monitor hates you, you might need framebuffers, and that's a newer kernel feature.

> [Kapil] Actually, inter-process-communication was required for X to first be ported to Linux. In other words Linux pre-ipcs (in the old version 0.12 days possibly upto version 0.98?) could not run X.

> [Ben] True, but then you may as well say that if you had no kernel, you couldn't run X either... 2.0.x is way after that. In practice, if you have a $GENERIC_KERNEL, X will work just fine.

Simply want to set it to pint to a canon bjc80 printer via parrallel port. I did recompiled the kernel for "lp" support, but do not know what to do next.

> [Ben] Well, the thing to do _first would have been reading the Printing-HOWTO (and perhaps the Printing-Usage-HOWTO) at <http://www.tldp.org/>;. It's always a good idea to look for a HOWTO when you are experimenting with a new and unfamiliar Linux subsystem.

For now, the lp ports is not detected yetby my linux system.

> [Ben] You don't really know that, actually. One way you can tell - it's a little subtle, actually - is by using the "file" utility and its "-s" (special file) option. The messages will vary a bit depending on whether the printing daemon is loaded or not.

>     # Starting with printing daemon loaded
>     ben@Fenrir:~$ file -s /dev/lp0
>     /dev/lp0: can't read `/dev/lp0' (Device or resource busy).
>     ben@Fenrir:~$ file -s /dev/lp1
>     /dev/lp1: can't read `/dev/lp1' (No such device or address).

> See the difference? Here it is with the daemon stopped:

>     ben@Fenrir:~$ su -c '/etc/init.d/cupsys stop'
>     Password:
>     Stopping CUPSys: cupsd.
>     ben@Fenrir:~$ file -s /dev/lp0
>     /dev/lp0: file: read failed (Input/output error).
>     ben@Fenrir:~$ file -s /dev/lp1
>     /dev/lp1: can't read `/dev/lp1' (No such device or address).

> Different message, but still understandable.

So how to manually (step by step, with no x window utility -- simply from command line) configure my printer.

> [Ben] Read the above HOWTOs; they'll walk you through the process. Feel free to let us know if you run into any problems you can't solve.

#####
Copyright © 2003
Copying license http://www.linuxgazette.com/copying.html
Published in Issue 92 of Linux Gazette, July 2003

###### HTML script maintained by Heather Stern of Starshine Technical Services, http://www.starshine.org/

| Meet the Gang 1 2 3 4 |