hplip-systray.desktop runs hp-systray in any case

Bug #213938 reported by Johannes Meixner
4
Affects Status Importance Assigned to Milestone
HPLIP
Fix Released
Undecided
Unassigned

Bug Description

/etc/xdg/autostart/hplip-systray.desktop runs hp-systray
regardless if there is any HPLIP device in use.

It is not feasible that each driver package just runs
its own tray application by default regardless if
the driver is actually in use on the particular system.

As a workaround for openSUSE 11.0 I added hp-systray.wrapper
which is a wrapper for hp-systray which runs it only if there is
a 'hp:/...' print queue.
Additionally I changed hplip-systray.desktop to run the wrapper
instead of hp-systray, see
https://bugzilla.novell.com/show_bug.cgi?id=377885

Instead of the wrapper, hp-systray may better check by itself
if there is any HPLIP device in use on the particular system
and exit silently if not.

Revision history for this message
Johannes Meixner (jsmeix) wrote :
Revision history for this message
dwelch91 (dwelch91) wrote : Re: [Bug 213938] Re: hplip-systray.desktop runs hp-systray in any case

Fixed in our tip code. New file attached, along with a patch to 2.8.4.

-Don

On Tue, Apr 8, 2008 at 6:09 AM, Johannes Meixner <email address hidden> wrote:

>
> ** Attachment added: "hp-systray.wrapper"
> http://launchpadlibrarian.net/13223121/hp-systray.wrapper
>
> --
> hplip-systray.desktop runs hp-systray in any case
> https://bugs.launchpad.net/bugs/213938
> You received this bug notification because you are a member of HP Linux
> Imaging and Printing, which is subscribed to HPLIP.
>

Revision history for this message
Johannes Meixner (jsmeix) wrote :

Many thanks for the fast patch!

The patch works but in many cases it does not work because of
https://bugs.launchpad.net/hplip/+bug/162196

For example on my workstation with CUPS 1.3.5:
------------------------------------------------------------------------
jsmeix@nelson:~> locale
LANG=en_GB.iso885915
LC_CTYPE="en_GB.iso885915"
LC_NUMERIC="en_GB.iso885915"
LC_TIME="en_GB.iso885915"
LC_COLLATE="en_GB.iso885915"
LC_MONETARY="en_GB.iso885915"
LC_MESSAGES="en_GB.iso885915"
LC_PAPER="en_GB.iso885915"
LC_NAME="en_GB.iso885915"
LC_ADDRESS="en_GB.iso885915"
LC_TELEPHONE="en_GB.iso885915"
LC_MEASUREMENT="en_GB.iso885915"
LC_IDENTIFICATION="en_GB.iso885915"
LC_ALL=en_GB.iso885915

jsmeix@nelson:~> hp-systray

HP Linux Imaging and Printing System (ver. 2.8.4)
System Tray Status Service ver. 0.1

Copyright (c) 2001-8 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

warning: No hp: or hpfax: devices found in any installed CUPS queue. Exiting.

jsmeix@nelson:~> lpstat -v | egrep 'hp:/|hpfax:/'
device for HP_LaserJet_1020: hp:/usb/HP_LaserJet_1020?serial=JL50HRE
device for HP_LaserJet_1220: hp:/usb/HP_LaserJet_1220?serial=00XXXXXXXXXX
device for lj1220ps: hp:/usb/HP_LaserJet_1220?serial=00XXXXXXXXXX
device for Officejet_7200: hp:/net/Officejet_7200_series?ip=10.10.100.100
device for Officejet_7200_fax: hpfax:/net/Officejet_7200_series?ip=10.10.100.100

jsmeix@nelson:~> export LC_ALL=POSIX
jsmeix@nelson:~> export LANG=POSIX

jsmeix@nelson:~> hp-systray

HP Linux Imaging and Printing System (ver. 2.8.4)
System Tray Status Service ver. 0.1

Copyright (c) 2001-8 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

------------------------------------------------------------------------

Revision history for this message
Johannes Meixner (jsmeix) wrote :

With the patch "hp-systray --help" fails:
----------------------------------------------------------
jsmeix@nelson:~> hp-systray --help

HP Linux Imaging and Printing System (ver. 2.8.4)
System Tray Status Service ver. 0.1

Copyright (c) 2001-8 Hewlett-Packard Development Company, LP
This software comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to distribute it
under certain conditions. See COPYING file for more details.

Usage: hp-systray [OPTIONS]

[OPTIONS]
  Force Qt3: --qt3 (default)
  Force Qt4: --qt4
Traceback (most recent call last):
  File "/usr/bin/hp-systray", line 88, in <module>
    usage()
  File "/usr/bin/hp-systray", line 53, in usage
    utils.format_text(USAGE, typ, __title__, 'hpssd.py', __version__)
  File "/usr/share/hplip/base/utils.py", line 1060, in format_text
    text1, text2, format, trailing_space = line
ValueError: need more than 3 values to unpack
----------------------------------------------------------

"hp-systray --force-startup" lets it at least run
without error messages but currently I don't know
what happens internally in hp-systray with CUPS 1.3.x
and a non-UTF-8 or non-POSIX locale.

Revision history for this message
dwelch91 (dwelch91) wrote :

Sorry, attached is a fixed patch.

I don't quite understand what is going on with the locale issues. If anyone
could give me a hand and point me in the right direction, I'd sure
appreciate it.

Thanks,

Don

On Wed, Apr 9, 2008 at 6:52 AM, Johannes Meixner <email address hidden> wrote:

> With the patch "hp-systray --help" fails:
> ----------------------------------------------------------
> jsmeix@nelson:~> hp-systray --help
>
> HP Linux Imaging and Printing System (ver. 2.8.4)
> System Tray Status Service ver. 0.1
>
> Copyright (c) 2001-8 Hewlett-Packard Development Company, LP
> This software comes with ABSOLUTELY NO WARRANTY.
> This is free software, and you are welcome to distribute it
> under certain conditions. See COPYING file for more details.
>
>
> Usage: hp-systray [OPTIONS]
>
> [OPTIONS]
> Force Qt3: --qt3 (default)
> Force Qt4: --qt4
> Traceback (most recent call last):
> File "/usr/bin/hp-systray", line 88, in <module>
> usage()
> File "/usr/bin/hp-systray", line 53, in usage
> utils.format_text(USAGE, typ, __title__, 'hpssd.py', __version__)
> File "/usr/share/hplip/base/utils.py", line 1060, in format_text
> text1, text2, format, trailing_space = line
> ValueError: need more than 3 values to unpack
> ----------------------------------------------------------
>
> "hp-systray --force-startup" lets it at least run
> without error messages but currently I don't know
> what happens internally in hp-systray with CUPS 1.3.x
> and a non-UTF-8 or non-POSIX locale.
>
> --
> hplip-systray.desktop runs hp-systray in any case
> https://bugs.launchpad.net/bugs/213938
> You received this bug notification because you are a member of HP Linux
> Imaging and Printing, which is subscribed to HPLIP.
>

Revision history for this message
Johannes Meixner (jsmeix) wrote :

Many thanks for the fixed patch.

I think for now I can ignore the encoding problem
because in openSUSE we use a UTF-8 encoding
by default for the users.

Since CUPS 1.3.x the cupsd accepts only requests
which are UTF-8 encoded (this includes 7-bit ASCII).
Therefore the communication with the cupsd fails
for HPLIP if HPLIP programs run under a non-UTF-8 locale
or under a non-POSIX locale.

As far as I see:
To make HPLIP work with CUPS 1.3.x independent
of the locale setting of the user who runs HPLIP programs,
you must ensure in your HPLIP programs that the
communication with the cupsd happens in UTF-8 encoding
and use 7-bit ASCII as fallback - but have possibly
non-7-bit-ASCII characters in mind, e.g. users may like
to have German umlauts 'ÄÖÜäöü' in queue names ;-)

To be on the safe side, I recommend to ask on the
CUPS mailing list <email address hidden> what the actually
correct way is to communicate with a CUPS 1.3.x cupsd.

Changed in hplip:
status: New → Triaged
Revision history for this message
Aaron Albright (albrigha-deactivatedaccount) wrote :

Released per Don.

Changed in hplip:
assignee: nobody → Aaron Albright (kalosaurusrex)
status: Triaged → Fix Released
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.