PDA

Bekijk de volledige versie : Port 9101 is difficult to access



monnier
31-07-2004, 20:19
My HP's driver installer, as well as my Mac OS X system makes it pretty difficult to use port 9101 instead of 9100 (with the Mac I have to manually edit the config file after creating the printer to turn the 9100 into 9101, with the HP driver installer on XP I haven't figured out how to do it yet).

Would it be possible to do the following:

if [ -f /dev/usb/lp0 ]; then
p910nd -f /dev/usb/lp0 0
p910nd -f /dev/printers/0 1
else
P910nd -f /dev/printers/0 0
fi

it could even be generalized to more USB printers, something like
(beware: pseudo sh code ahead):

port=0
while [ -f "/dev/usb/lp$port" ]; do
p910nd -f "/dev/usb/lp$port" $port
port=(( $port + 1 ))
done
p910nd -f /dev/printer/0 $port

The point is to make sure that if you have only 1 printer connected
(i.e. the common case) the port to use is the normal 9100.

Oleg
31-07-2004, 22:15
Do it yourself if you need this using flashfs. USB printers are hotplugable, so detecting them on start-up is not a good idea. Also, multiple printer configuration is hard to maintain due to reordering on the USB bus.

monnier
01-08-2004, 19:18
Hmm... the hotpluggable part is not a big problem for me (and I expect
I'm not unusual in this respect: the whole point of a printserver like
that is to plug your printer once and for all), but the potential reordering
is indeed a problem. Hmmm....

By the way: the problem with your suggestion of doing it with flashfs
is that /init/rc.prnsvr is started during the boot up, so in the pre-boot
script it's too early and in the post-boot it's too late (I've had to do a
"ps | grep" to find the process IDs, then kill them, which is pretty
clunky).
Not that it can't be done, but it's clunky.

Oleg
11-08-2004, 21:14
Use iptables for redirecting 9101 to 9100. That's the simplest solution. :)