Mailinglist Archive: opensuse-factory (454 mails)

< Previous Next >
Re: [opensuse-factory] xdpyinfo is using 100% of one cpu
Le jeudi 21 décembre 2017 à 15:21 -0500, Patrick Shanahan a écrit :
* Jan Engelhardt <jengelh@xxxxxxx> [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).

--
Frederic Crozat
Enterprise Desktop Release Manager
SUSE

--
To unsubscribe, e-mail: opensuse-factory+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: opensuse-factory+owner@xxxxxxxxxxxx

< Previous Next >
Follow Ups