Article 6QXK1 Zenity Password Prompt Fails After Long Suspend (ACPI Issue)

Zenity Password Prompt Fails After Long Suspend (ACPI Issue)

by
GFdeb12
from LinuxQuestions.org on (#6QXK1)
I'm encountering an issue with my Slackware stable where the Zenity password prompt, used to unlock an encrypted ssd after resuming from suspend, fails to appear only after a long suspend. If the laptop lid is closed and suspended for just a few minutes, the script works fine, and the Zenity prompt appears. However, after the system has been in standby for an extended period, the Zenity prompt doesn't show up, and I see errors related to the X display.

My Setup:

Distro: 15.0 Stable
Encryption: tcplay (TrueCrypt)
ACPI: ACPI events trigger the unlock script when the laptop lid is opened.
Password Prompt: Zenity is used to prompt for the decryption password.

The Problem:

1. Short Suspend: If the system is suspended for a few minutes, everything works as expected. The Zenity prompt appears, and I can unlock the encrypted ssd.

2. Long Suspend: After a longer suspend (over 30 minutes or so), the Zenity prompt often fails to appear. I get errors like Gtk-WARNING **: cannot open display: :0.0 or no prompt at all. The decryption process doesn't proceed.

3. Encryption on Lid Close: The script that encrypts the ssd when the lid is closed runs without any issues and is triggered by ACPI successfully every time.

My ACPI Script:

Event:

Code:event=button/lid LID open
action=/etc/acpi/actions/resume_action.shAction:

Code:#!/bin/bash

sleep 10

export DISPLAY=:0
export XAUTHORITY=/home/triplum/.Xauthority

xhost +SI:localuser:triplum

sleep 2

/usr/local/sbin/tcplay_open_lid.shWhat I've Tried:

Delays: Added sleep 10 to give the system time to fully wake up.
Environment Variables: Exported DISPLAY and XAUTHORITY for the X session.
xhost: Added xhost +SI:localuser:triplum to allow user access to the X session.
Logging: Logs sometimes show the Gtk-WARNING about zenity not being able to open the display after a long suspend.

What Works:

Short Suspend: When the suspend period is short, the Zenity prompt appears and allows me to unlock the encrypted drive.

Lid Close Encryption: The script that handles encryption when the lid is closed works flawlessly. It is always triggered by ACPI and runs without any issues.

Tested with and without sudo:
I have tested the script both with and without sudo, but the problem persists either way after a long suspend.

Question:
Has anyone experienced similar issues with ACPI, Zenity, or X session handling after a long suspend? How can I ensure that the Zenity prompt reliably appears regardless of how long the system has been suspended?

Any advice or suggestions would be greatly appreciated!

ps.. This is the second internal SSD in my system.
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments