You are not logged in.

#1 2018-02-20 01:20:42

peachrobber
Member
Registered: 2018-02-19
Posts: 8

hp-systray does not release lock after X session logout

The hp-systray file in the hplip package doesn't delete ~/.hplip/hp-systray.lock after I log out of my X session.

I use LXDE as my desktop environment. "hp-systray" is in my .config/lxsession/LXDE/autostart file, with the intent of loading hp-systray to the taskbar. I used to load LXDE through lxdm (default configuration). When I did that, hp-systray would always load to the taskbar at login. I started logging in with startx as recommended in the Security page on the Arch wiki. Now, hp-systray loads intermittently. The cause appears to be that when I log out (through the menu options, not with a manual kill command of some sort), the lock file doesn't get deleted. I can delete the lock file manually, and then it works fine.

I'm interested in this because of the possibility that the logout method I'm using might be closing processes ungracefully, not so much because of the specific impact to hp-systray. I can get what I need from hplip without hp-systray. (Just run hp-toolbox directly.)

I posted this in the Newbie Corner because I'm new to the Arch Linux forums in general, so I don't really know where to put things.

I considered logging in through GDM rather than through startx to see if that would solve the issue, since I could still have a rootless X session with GDM. I'm uninterested in that because I'd like to keep the software on my aging laptop as lean as possible. GNOME doesn't seem particularly lean (and I don't like it anyway), and gdm requires quite a few packages I don't have installed.

Offline

#2 2018-02-20 11:19:11

peachrobber
Member
Registered: 2018-02-19
Posts: 8

Re: hp-systray does not release lock after X session logout

More playing around reveals that when I kill hp-systray with SIGTERM, it doesn't delete the lock file, but when I exit it through its menu, it does. I guess that points to it being a small problem in hplip (possibly; maybe they never intended the tray icon to respond to SIGTERM).

I still don't know how to figure out what, if anything, lxde-logout does to terminate processes, or why that would differ depending on whether the process that was returned to was LXDM, a TTY, or something else. But (assuming that programs should terminate nicely when killed with SIGTERM) this seems to indicate that hplip is just behaving badly, rather than that something is fundamentally wrong with starting LXDE through startx.

Offline

#3 2018-02-24 01:27:24

peachrobber
Member
Registered: 2018-02-19
Posts: 8

Re: hp-systray does not release lock after X session logout

Since I started to post the issues I'm having, posting more details...

Changing /usr/share/hplip/base/g.py line 49 to

log.set_level('debug')

produced a more interesting output than I normally get when invoking hp-systray:

[1876]: debug: Unable to open file /var/lib/hp/hplip.state for reading.

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

Copyright (c) 2001-15 HP 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-systray[1876]: debug: Locking: /home/thomas/.hplip/hp-systray.lock
hp-systray[1876]: debug: Creating pipe: hpssd (6) ==> systemtray (5)
hp-systray[1876]: debug: Creating pipe: hpssd (7) ==> hpdio (5)
hp-systray[1876]: debug: Creating pipe: hpdio (9) ==> hpssd (8)
hp-systray(hpdio)[1878]: debug: PID=1878
hp-systray(hpssd)[1877]: debug: PID=1877
hp-systray(hpssd)[1877]: debug: Entering main dbus loop...
hp-systray(qt5)[1876]: debug: PID=1876
hp-systray(qt5)[1876]: debug: Loading user settings...
hp-systray(qt5)[1876]: debug: FAB command: /usr/bin/hp-fab 
hp-systray(qt5)[1876]: debug: Scan command: /usr/bin/xsane -V %SANE_URI%
hp-systray(qt5)[1876]: debug: Auto refresh: False
hp-systray(qt5)[1876]: debug: Auto refresh rate: 30
hp-systray(qt5)[1876]: debug: Auto refresh type: 1
hp-systray(qt5)[1876]: debug: Systray visible: 0
hp-systray(qt5)[1876]: debug: Systray messages: 0
hp-systray(qt5)[1876]: debug: Last used device URI: hp:/net/ENVY_5540_series?zc=HPDC4A3E20C7A3
hp-systray(qt5)[1876]: debug: Last used printer: 
hp-systray(qt5)[1876]: debug: Working directory: .
hp-systray(qt5)[1876]: debug: Cache miss: envy_5540_series
hp-systray(qt5)[1876]: debug: Reading file: /usr/share/hplip/data/models/models.dat
hp-systray(qt5)[1876]: debug: Searching for section [envy_5540_series] in file /usr/share/hplip/data/models/models.dat
hp-systray(qt5)[1876]: debug: Found section [envy_5540_series] in file /usr/share/hplip/data/models/models.dat
hp-systray(qt5)[1876]: debug: handle_hplip_updation upgrade_notify =0
hp-systray(qt5)[1876]: debug: upgrade notification is disabled in systray 
hp-systray(qt5)[1876]: debug: Running hp-upgrade: /usr/bin/hp-upgrade 
[1884]: debug: Unable to open file /var/lib/hp/hplip.state for reading.

HP Linux Imaging and Printing System (ver. 3.17.11)
HPLIP upgrade latest version ver. 1.0

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

error: HPLIP upgrade is disabled by Archlinux for security reasons, see https://bugs.archlinux.org/task/38083 - if you like to upgrade HPLIP, use the Archlinux software package manager pacman.

Done.
hp-systray(hpssd)[1877]: debug: GetHistory('hp:/net/ENVY_5540_series?zc=HPDC4A3E20C7A3')
hp-systray(qt5)[1876]: debug: Showing...

Closing hp-systray through the taskbar icon prints:

hp-systray(hpssd)[1877]: debug: GetHistory('hp:/net/ENVY_5540_series?zc=HPDC4A3E20C7A3')
hp-systray(qt5)[1876]: debug: Showing...
hp-systray(qt5)[1876]: debug: Exiting
hp-systray(hpssd)[1877]: debug: Handling event...
hp-systray(hpssd)[1877]: debug: Exiting
hp-systray(hpdio)[1878]: debug: Handling event...
hp-systray(hpdio)[1878]: debug: Exiting
hp-systray(qt5)[1876]: debug: Unlocking: /home/thomas/.hplip/hp-systray.lock

Reopening hp-systray (with pid's 1897, 1898, 1899 this time) and typing

kill 

in another terminal (I'm guessing that lxde-logout does something like this) produces the following output:

Terminated

I suppose the follow-on questions would be:

  • What signal sent to hp-systray (if any) terminates it according to the longer form shown above (debug: Exiting)

  • How lxde-logout terminates processes

  • If there is a way to get the two programs to communicate nicely with each other on logout, so that the lock file is removed gracefully without me having to delete it manually

If this is wasting space on the forums let me know, but otherwise I thought that what's interesting for me to debug might possibly be interesting or useful for someone else...

Offline

Board footer

Powered by FluxBB