Starting a X-application from a user-daemon - Xwindows
This is a discussion on Starting a X-application from a user-daemon - Xwindows ; I nee opera to be started from a daemon, e.g. from watch-daemon. But it
doesn't work! Starting opera from a xterm or starting a skript that
involves the opera-start-command works fine. But not when the daemon
tries to start opera. ...
-
Starting a X-application from a user-daemon
I nee opera to be started from a daemon, e.g. from watch-daemon. But it
doesn't work! Starting opera from a xterm or starting a skript that
involves the opera-start-command works fine. But not when the daemon
tries to start opera. Is that problem known to somebody of You?
Here are details. This Skript starts opera, working fine if started from
a xterm, but not when started by e.g. watch:
#!/bin/sh
# the same opera shows two different URL's automatically
#
export DISPLAY=0:0.0
/usr/bin/opera -remote openURL\(http://localhost/scan/p.php?nr=555\)
sleep 3; echo "skript is touched ..." >> /tmp/test.txt
/usr/bin/opera -remote openURL\(http://localhost/scan/p.php?nr=666\)
In .profile of the user (user gerlach, thats me) I start watch-daemon:
# event: if a file az_xxxx, e.g. az_555 exists -> start opera
cmd='e=`ls /home/L/instruct/ -1t | grep az_ | tail -n 1`;
[ $e ] && rm /home/L/instruct/az_* && xterm -e /home/gerlach/tt '
watch -n 1 -t $cmd &
/tmp/test is full with "skript is touched .."-lines. The skript is
walked through entirely. But the opera's are not started (sometimes
one opera is started, but not with the specific URL) on X.
With ps axw I can observe serveral opera's waiting in "S"-State.
2921 pts/11 S 0:00 /usr/lib/opera/7.51-20040602.5/opera
--binarydir /usr/lib/opera/7.51-20040602.5/ -remote
openURL(http://localhost/scan/p.php?nr=555)
2937 pts/11 S 0:00 /usr/lib/opera/7.51-20040602.5/opera
--binarydir /usr/lib/opera/7.51-20040602.5/ -remote
openURL(http://localhost/scan/p.php?nr=555)
Anybody here who can help me?
thanks in advance
Ekkard
-
Re: Starting a X-application from a user-daemon
>
> 2921 pts/11 S 0:00 /usr/lib/opera/7.51-20040602.5/opera
> --binarydir /usr/lib/opera/7.51-20040602.5/ -remote
> openURL(http://localhost/scan/p.php?nr=555)
> 2937 pts/11 S 0:00 /usr/lib/opera/7.51-20040602.5/opera
> --binarydir /usr/lib/opera/7.51-20040602.5/ -remote
> openURL(http://localhost/scan/p.php?nr=555)
and thats what the two processes are "doing":
gerlach@rex2:~>strace -p 2921
select(7, [3 4 6], [], [], {0, 10000}) = 0 (Timeout)
gettimeofday({1089824030, 945826}, NULL) = 0
gettimeofday({1089824030, 945948}, NULL) = 0
gettimeofday({1089824030, 946031}, NULL) = 0
gettimeofday({1089824030, 946054}, NULL) = 0
gettimeofday({1089824030, 946076}, NULL) = 0
ioctl(3, FIONREAD, [0]) = 0
gettimeofday({1089824030, 946155}, NULL) = 0
select(7, [3 4 6], [], [], {0, 0}) = 0 (Timeout)
gettimeofday({1089824030, 946260}, NULL) = 0
gettimeofday({1089824030, 946331}, NULL) = 0
gettimeofday({1089824030, 946351}, NULL) = 0
gettimeofday({1089824030, 946367}, NULL) = 0
gettimeofday({1089824030, 946383}, NULL) = 0
gettimeofday({1089824030, 946400}, NULL) = 0
gettimeofday({1089824030, 946444}, NULL) = 0
ioctl(3, FIONREAD, [0]) = 0
gettimeofday({1089824030, 946488}, NULL) = 0
select(7, [3 4 6], [], [], {0, 99912}) = 0 (Timeout)
gettimeofday({1089824031, 45867}, NULL) = 0
ioctl(3, FIONREAD, [0]) = 0
gettimeofday({1089824031, 46006}, NULL) = 0
select(7, [3 4 6], [], [], {0, 394}) = 0 (Timeout)
gettimeofday({1089824031, 55685}, NULL) = 0
gettimeofday({1089824031, 55741}, NULL) = 0
gettimeofday({1089824031, 55820}, NULL) = 0
gettimeofday({1089824031, 55843}, NULL) = 0
[...]
gerlach@rex2:~>strace -p 2937
getppid() = 2921
poll([{fd=14, events=POLLIN}], 1, 2000) = 0
getppid() = 2921
poll([{fd=14, events=POLLIN}], 1, 2000) = 0
getppid() = 2921
poll([{fd=14, events=POLLIN}], 1, 2000) = 0
getppid() = 2921
poll([{fd=14, events=POLLIN}], 1, 2000) = 0
getppid() = 2921
poll([{fd=14, events=POLLIN}], 1, 2000) = 0
getppid() = 2921
[...]
BTW: xterm -e and sh -c are tried in serveral places with no success
tia
Ekkard
-
Re: Starting a X-application from a user-daemon
ekkard gerlach writes:
> I nee opera to be started from a daemon, e.g. from watch-daemon. But it
> doesn't work! Starting opera from a xterm or starting a skript that
> involves the opera-start-command works fine. But not when the daemon
> tries to start opera. Is that problem known to somebody of You?
>
> Here are details. This Skript starts opera, working fine if started from
> a xterm, but not when started by e.g. watch:
>
> #!/bin/sh
> # the same opera shows two different URL's automatically
> #
> export DISPLAY=0:0.0
This can't be a correct setting of the DISPLAY variable. It should
probably be:
export DISPLAY=:0.0
But I might not work anyway, due to X security. See the man page
Xsecurity.
--
- Mårten
mail: msv@kth.se *** ICQ: 4356928 *** mobile: +46 (0)707390385
-
Re: Starting a X-application from a user-daemon
f95-msv@f.kth.se (Mårten Svantesson) writes:
> But I might not work anyway, due to X security. See the man page
> Xsecurity.
Actually, the xauth man page might be more useful.
--
- Mårten
mail: msv@kth.se *** ICQ: 4356928 *** mobile: +46 (0)707390385