I'm trying to launch a message box from a python systemd service which is running as root.
subprocess.Popen(["/usr/bin/zenity", "--info", "--text", "please reboot for changes to take effect"], env=dict(os.environ, DISPLAY="0.0", XAUTHORITY="/home/pi/.Xauthority"))
I've set the environment variable DISPLAY and XAUTHORITY however I still get a connection refused message
** (zenity:5491): WARNING **: Could not open X display
Unable to init sever: Could not connect: Connection refused
(zenity:5491): Gtk-WARNING **: cannot open display: 0.0
Is there anything I'm missing here?