udev systemd service zenity

Asked by geole0

Hello.

With Ubuntu version 24.04, I created a UDEV rule to detect when an external drive is mounted.

This rule launches a systemd service in root mode

This service runs a user script that uses the Zenity application to ask a question to the user logged in with Wayland.

This works perfectly.

I'm currently replicating this to make it work with Ubuntu 26.04 Resolute Raccoon (development branch)

The process works fine except that when the following command is executed, the terminal freezes. It becomes impossible to do anything else; the only option is to boot from the system by pressing the power button.

The command responsible is:

DISPLAY=0:1 zenity --entry --title="Mounting partition $Data ($i/20)." --text "please provide the decryption phrase for $Data."

I'm not too surprised that it doesn't work well since X11 is gone.

Just in case, I thought I'd enable this option.

WAYLAND_DISPLAY=0:1 zenity --entry --title="Mounting partition $Data ($i/20)." --text "please provide the decryption phrase for $Data."

In this case, the blockage is lifted, but nothing is displayed on the screen. I noted that the log then indicates this error.

janv. 09 16:29:16 a Sauvegarde.sh[15315]: Authorization required, but no authorization protocol specified
janv. 09 16:29:16 a zenity[15315]: Failed to open display
janv. 09 16:29:16 a systemd[1]: Sauvegarde@-dev-sdc.service: Main process exited, code=exited, status=1/FAILURE

Please note that I also use this exact command executed from a systemd --user service. In this context, it works correctly...

Thank you.

Question information

Language:
English Edit question
Status:
Open
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

Can you help with this problem?

Provide an answer of your own, or ask geole0 for more information if necessary.

To post a message you must log in.