HP officejet needs hpoj

Bug #12379 reported by Ka-Hing Cheung
6
Affects Status Importance Assigned to Milestone
cupsys (Ubuntu)
Fix Released
Medium
Martin Pitt

Bug Description

I am not sure what package this bug belongs to, since it's about printing I just
choose cupsys.

I have a HP OfficeJet K80 multifunction printer connected via USB. Out of the
box Ubuntu detects it and lets me add it (gnome-cupsys frontend), but printing
doesn't work (the notification icon shows up, but nothing prints).

Workaround: Installing hpoj from universe, and setup the printer there (sudo
/etc/init.d/hpoj setup), then use gnome-cups frontend again to add the printer,
and make sure you use the one provided by hpoj.

Should hpoj be added to Ubuntu? Searching on the forum it seems several other
OfficeJects are affected.

Revision history for this message
Matt Zimmerman (mdz) wrote :

Hmm, it is certainly required for scanning, but I did not think it was required
for printing.

I'm using it here with an OfficeJet 55xx, so I'm also interested in supporting
it. It shouldn't be too much of a problem to get it included in the desktop set
along with other printer support tools, but the following concerns do need to be
addressed first:

- The hpoj daemons run with far too much privilege
- hpoj.postinst interacts with the user
- /etc/init.d/hpoj.init should be fast and silent if the user does not have the
relevant hardware

Revision history for this message
Ka-Hing Cheung (kahing) wrote :

Well, it doesn't print here until I installed hpoj, and prints right after I
installed hpoj and re-added the printer. Before I installed hpoj there was no
error messages in /var/log/messages nor /var/log/cups/error_log, even if I set
cups debug level to debug6762.

I am not familiar with the priviledge issue, but for me the post-inst was the
same as /etc/init/hpoj setup, and for that all I needed to do was press Return.

Before I installed hpoj gnome-cupsys detected my K80 as K60, and I had to
manually select K80, and from /var/log/messages it seems that hotplug or
whatever knows that it's a USB printer when it's plugged in, so it seems there
should be enough information to answer everything in hpoj setup already?

Revision history for this message
Martin Pitt (pitti) wrote :

I removed the interactive configuration from the postinst (that's the easy part
:-) ).

However, lacking an OJ I have absolutely no opportunity to test the derooting
(the daemon does not even start for me), so I need your help for testing. I
modified the init script to launch the daemons as daemon:lp instead of
root:root, which should be enough in principle. The patch is not yet perfect,
but it should already be enough to check whether it works.

Can you please temporarily move away /etc/init.d/hpoj and replace it with the
version I will attach? Please report whether (and to which extend) it works.

Thanks in advance!

Revision history for this message
Martin Pitt (pitti) wrote :

Created an attachment (id=1312)
/etc/init.d/hpoj which starts daemons as non-root

Revision history for this message
Ka-Hing Cheung (kahing) wrote :

So I should do /etc/init.d/hpoj stop, replace hpoj, then /etc/init.d/hpoj start?
Will try that tonight.

Revision history for this message
Matt Zimmerman (mdz) wrote :

A few more changes were required; I'm fixing the last bits now.

Revision history for this message
Matt Zimmerman (mdz) wrote :

Created an attachment (id=1313)
Complete patch to run as non-root

I tested printing and scanning with this patch, and it works.

Revision history for this message
Ka-Hing Cheung (kahing) wrote :

Cool, if you have a deb and want me to test it as well just let me know.

Revision history for this message
Daniel Stone (daniels) wrote :

I have a PSC1210, and to switch between scanning and printing, you need to turn
the printer off, unplug it, stop cupsys, stop hpoj, and restart them (but not
restarting cupsys if you want to scan instead). That aside, hpoj works fine for
me, and its promotion to main would rock.

Revision history for this message
Martin Pitt (pitti) wrote :

 hpoj (0.91-3ubuntu1) hoary; urgency=low
 .
   * debian/postinst:
     - Remove call to interactive configuration.
     - Create system user "hpojlp" (with primary group lp).
   * Added debian/postrm:
     - Remove system user "hpojlp" on purge.
   * De-rootification:
     - Modify ptal-printd to only attempt chown() if it is actually necessary.
       (Thanks to Matt Zimmerman)
     - scripts/ptal-init.in: Start processes as hpojlp:lp instead of root:root
       and modify directory permissions accordingly (Thanks to Matt for this
       bit).
   * Added debian/README.Debian: Explain how to call setup program.
   * debian/rules: Remove apps/xojpanel/Makefile on clean.
   * (Ubuntu #6000)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.