* Frederic Crozat <fcrozat@suse.com> [12-22-17 03:24]:
Le jeudi 21 décembre 2017 à 15:21 -0500, Patrick Shanahan a écrit :
* Jan Engelhardt <jengelh@inai.de> [12-21-17 14:45]:
On Thursday 2017-12-21 15:46, Patrick Shanahan wrote:
I have a python backup instance runs at 3am every day, backintime: /usr/share/backintime/common/tools.py def check_x_server(): return 0 == os.system( 'xdpyinfo >/dev/null 2>&1' )
for some reason the xdpyinfo instance persists.
So, does your script have DISPLAY set when it shouldn't?
backintime in ~/.local/share/backintime/cron_env shows: DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus DISPLAY=:0 KDE_FULL_SESSION=true XAUTHORITY=/tmp/xauth-1000-_0
so, I guess that would be "yes", but I don't know that it shouldn't ??? or, if in fact that does set $DISPLAY.
suggestions welcome, I know *nearly* nothing :)
Honestly, doing this kind of hacks to detect if X is running is really broken (you could be logged on another display, XAUTHORITY file might be at another non-guessable location, if you use gdm, for instance, etc..)
It would be much better to query logind through loginctl to see if user "whatever" has a session open (or through dbus call to logind).
you are speaking above me :(. and if the hangng xdpyinfo instance is to determine a graphic session open, what use is it for a "text" application, backintime is a python script? -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Registered Linux User #207535 @ http://linuxcounter.net Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet freenode -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org