This forum has been archived. All content is frozen. Please use KDE Discuss instead.

What the heck is going on??

Tags: None
(comma "," separated)
lrhorer
Registered Member
Posts
7
Karma
0

What the heck is going on??

Fri Sep 18, 2009 1:46 am
OK, this *HAS* to be something simple I am missing, but for the life of me I cannot figure out what.

I have a very simple shell script which refuses to work, giving me grief about the display. Extremely similar scripts run just fine.

Here is the script:

#! /bin/bash
amarok --pause
xset dpms force on

That's it. When I run the script, I get:

AlarmClock:~# AlarmSnooze
: cannot connect to X server :0.0
xset: unable to open display ":0.0"


I've tried setting the DISPLAY variable explicitly as well as exporting it, I've tried it under both Konsole and an ordinary xterm as well as in a system call from a binary application, and I've tried using the "display=" command line option. An extremely similar script in the very same directory runs just fine:

#! /bin/bash
amarok -p
xset dpms force on
kill -USR1 `cat /var/run/Alarm_Clock.pid`
AlarmStop &


The permissions and ownership are identical. I'm stumped.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: What the heck is going on??

Fri Sep 18, 2009 6:32 am
Can you check the permissions of the ~/.XAuthority* files? Try removing all of them outside of a X session also if more than just ~/.XAuthority exists.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
mzneverdies
Registered Member
Posts
20
Karma
0
OS

Re: What the heck is going on??

Fri Sep 18, 2009 10:08 pm
two tries:

1) DISPLAY=:0

2) xhost +

the first sets the DISPLAY variable to :0, which should be your x-based running session.

the second allows to launch x-based programs to the existing session, but from another user (which in this case seems to be root "AlarmClock:~# AlarmSnooze")

i would say the second option will work for sure, so launch it as your normal user before, and if it does, add it to the autostart program list


mzneverdies, proud to be a member of KDE forums since 2008-Dec.
lrhorer
Registered Member
Posts
7
Karma
0

Re: What the heck is going on??

Thu Sep 24, 2009 1:09 am
I found the differential, but I don't know why, exactly. It turns out one of the processes was running as root, the other as an ordinary user. The ordinary user's process was able to access the display just fine, but any time one of the scripts is run as root, it croaks, complaining about not being able to access the display. I'll look into xhost+.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]