APLawrence - Information and Resources for Unix and Linux Systems, Bloggers and the self-employed
RSS Feeds Get APLawrence.com by RSS














(OLDER) <- More Stuff -> (NEWER) (NEWEST)
Printer Friendly Version



2005/03/31 IPP

Internet Printing Protocol which is what CUPS uses. You may know that if you fire up your web browser and point it at http://localhost:631 you get the CUPS administration screen, but did you realize that CUPS itself sends print and status requests to the same port?

There's nothing secret about this: CUPS documentation (which you can find at http://localhost:631/ipp.html ) explains all of it. If you wanted to, you could control CUPS directly with HTTP requests. We can demonstrate that with a little tom-foolery: let's create a little shell script that we'll run on port 631. First the script, which logs attempted connections.

#!/bin/bash
echo "Connection" >> /tmp/fakecupsd
date >> /tmp/fakecupsd
read line
echo $line >> /tmp/fakecupsd
 

We turn that on by creating a file in /etc/xinetd, stopping the real cups, and telling xinetd to start using ours for port 631 connections.



# cat /etc/xinetd.d/fakecups
service ipp
{
        socket_type     = stream
        wait            = no
        user            = root
        server          = /root/fakecups
}
/etc/init.d/cups stop
kill -1 `cat /var/run/xinetd.pid`
 

Now do an "lpstat -v" - it will hang, so ctrl-c it, and look in /tmp/fakecupsd. You'll see something like this repeated multiple times:

Connection
Sat Mar 26 05:36:30 EST 2005
POST / HTTP/1.1
 

The reason lpstat hangs is that it is sending more data with that http post, which the real cups daemon would process and acknowledge.




Click here to add your comments





Thu Mar 31 13:46:18 2005: Subject:   drag



I prefer using IPP over using something like SAMBA. It seems much nicer to me.

Windows clients support IPP since Windows 2000, and I've tried it and it works very well... for me. IPP basicly turns your computer in a postscript-compatable networked printer.

But I've been told that Windows IPP support is sub-par and usually SAMBA is going to be better for large numbers of windows clients.

Although if you use Unix ones, especially ones that use CUPS (ie: Linux or FreeBSD or OS 10.2(10.2.4(?)) or newer) then it rocks.

--Drag

Don't miss responses! Subscribe to Comments by RSS or by Email

Click here to add your comments


If you want a picture to show with your comment, go get a Gravatar


cartoon

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

Jump to Comments



Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.

Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.

We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.


book graphic unix and linux troubleshooting guide

My Troubleshooting E-Book will show you how to solve tough problems on Linux and Unix systems!



 I sell and support
 Kerio Mail server




pavatar.jpg
More:
       - Printing




Related Posts

Cups print to file

Print to FAX with custom tags

Redhat /etc/alternatives

Using System V interface scripts with CUPS printing

CUPS and Netgear PS110

Sco/Linux transition guide

Cups bought by Apple



Unix/Linux Consultants

Skills Tests

Guest Post Here











My Favorites

Change Congress