hplip_clean.sh cannot access /var/log/hp/ and produces error messages

Bug #1217778 reported by Jaromír Končický
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HPLIP
Fix Released
Undecided
Unassigned
Fedora
Won't Fix
Undecided

Bug Description

This bug was already reported on Red Hat Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=988529
I investigated it a bit and found out that in "ui4/systemtray.py" there is called shell script "/usr/share/hplip/hplip_clean.sh" which tries to access "/var/log/hp/" directory (namely on line 36, 37, 38) but it cannot because of permissions and produces error messages.
I solved this problem by adding a check whether script may access this directory:

# First check if the script may write to /var/log/hp/ directory
if ! [ -w /var/log/hp/ ]; then
 exit 0
fi

This suppresses the error messages but doesn't solve the actual problem and old logs are not erased as intended by the script.
Do you have any better solution for this or I can just add the check?

Revision history for this message
In , pgaltieri (pgaltieri-redhat-bugs) wrote :

Description of problem:
When running hp-toolbox as regular user the following errors are output

/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py:122: RuntimeWarning: PyOS_InputHook is not available for interactive use of PyGTK
  set_interactive(1)
mkdir: cannot create directory '/var/log/hp': Permission denied
chgrp: cannot access '/var/log/hp/tmp/': Permission denied
chmod: cannot access '/var/log/hp/tmp/': Permission denied

Version-Release number of selected component (if applicable):
3.13.6-2.fc19

How reproducible:
It occurred when I ran it for the first time after installation.

Steps to Reproduce:
1. Install hplip-gui-3.13.6-2.fc19.x86_64
2. Run hp-setup as root and create a printer
3. Run hp-toolbox as regular user

Actual results:
PyOS_InputHook is not available for interactive use of PyGTK
  set_interactive(1)
mkdir: cannot create directory '/var/log/hp': Permission denied
chgrp: cannot access '/var/log/hp/tmp/': Permission denied
chmod: cannot access '/var/log/hp/tmp/': Permission denied

Expected results:
No error messages

Additional info:
Don't know why hp-toolbox attempts to create the directories since they are listed as part of the hplip-3.13.6-2.fc19.x86_64 package.

The first time I ran hp-toolbox I got the following messages:

HP Linux Imaging and Printing System (ver. 3.13.6)
HP Device Manager ver. 15.0

Copyright (c) 2001-13 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.

HP Linux Imaging and Printing System (ver. 3.13.6)
System Tray Status Service ver. 2.0

Copyright (c) 2001-13 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.

/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py:122: RuntimeWarning: PyOS_InputHook is not available for interactive use of PyGTK
  set_interactive(1)
mkdir: cannot create directory '/var/log/hp': Permission denied
chgrp: cannot access '/var/log/hp/tmp/': Permission denied
chmod: cannot access '/var/log/hp/tmp/': Permission denied

The second time I ran it I got the following:

HP Linux Imaging and Printing System (ver. 3.13.6)
HP Device Manager ver. 15.0

Copyright (c) 2001-13 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.

Note that it printed the "HP Linux Imaging and Printing System" once the second time I ran it.

Revision history for this message
In , Jaromír (jaromr-redhat-bugs) wrote :

I found out that these mkdir, chgrp, chmod commands, causing the error messages, are called from /usr/share/hplip/hplip_clean.sh (line 36).

Revision history for this message
In , Jaromír (jaromr-redhat-bugs) wrote :
Revision history for this message
Amarnath Chitumalla (amarnath-chitumalla) wrote :

Hi,

Thank you for reporting the issue. We will look into this!!

Thanks & Regards,
Amarnath

Changed in hplip:
status: New → Fix Committed
status: Fix Committed → Fix Released
Revision history for this message
Amarnath Chitumalla (amarnath-chitumalla) wrote :

Hi,

Changed hplip_clean.sh logic in HPLIP-3.13.10,

Now debug enabled logs (i.e. After changing cups conf file and set hp log levels) will be created in "/var/spool/cups/tmp" folder instead of "/var/log/hp/tmp" folder. HPLIP won't clean periodically as "/var/spool/cups/tmp" folder will be cleared on each reboot.

Thanks & Regards,
Amarnath

Revision history for this message
In , Jaromír (jaromr-redhat-bugs) wrote :

Fixed in HPLIP-3.13.10.
Upstream fix described here: https://bugs.launchpad.net/hplip/+bug/1217778/comments/2

Changed in fedora:
importance: Unknown → Undecided
status: Unknown → Won't Fix
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.