Bill Shirley wrote:



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of German Guillot
Sent: Thursday, August 05, 2004 9:29 AM
To: [EMAIL PROTECTED]
Subject: Re: [newbie] Cron doesn't run for user


On Thu, 5 Aug 2004 08:29:16 -0400, Bill Shirley <[EMAIL PROTECTED]> wrote:


[EMAIL PROTECTED] tmp]# cat testg
#!/bin/sh

export DISPLAY=:0.0

echo $DISPLAY

/usr/bin/galeon

#/usr/bin/mozilla

Works for me!



Rats! I sure wish I could say the same. Just to be sure, do you mean
it's working as a cron job, opening a browser window at certain times?
Because that's what I can't get it to do. I can use the script to open
Galeon if I run it from an xterm, but that's it. I've tried putting it
in a crontab for root, I've tried logging in from run level 3 and then
typing startx (but the X process is still owned by root), no result.

I have got cron to do other things, but not this. It's like Mikkel said:



I bet it will not work from the command line if you are at the command
line interface, instead of the command line in an xterm. Any command
that needs X to run will NOT work in a cron job. This is because it can
not connect to an X server - at least not with the default security
settings. It is not a good idea to change the settings to allow this,
unless you are on an isulated machine. (I remember playing tricks on
people running an open X server...) ;)


So do you have your security settings tweaked to allow you to connect
to the X server? Because what he says there seems to fit the behaviour
on my system exactly, and I'd decided it wasn't worth compromising
security for this. But I'm also pretty sure that there must be a
workaround (or maybe I'm just mule-headed).

Germán.





Works from a cron job: 44 11 * * * /root/tmp/tmp/testg

Here is my setup:
I have vncserver running on my server.  I open root's desktop with vncviewer
from another PC.  From the same "another PC", I ssh in and can run the
script which starts galeon and the window opens in vncviewer.  (I only use
the real console in emergencies.)  The ssh terminal does not have the
environment variable DISPLAY set;  thus emulating the environment of cron
jobs.

This setup also works if the script is run from cron.  I tested it here.

I'm not sure what you guys are talking about when you say security settings.

The "another PC" is on my local LAN and the server allows a connection.

[EMAIL PROTECTED] tmp]# cat testg
#!/bin/sh

export DISPLAY=:0.0
echo $DISPLAY

/usr/bin/galeon
#/usr/bin/mozilla

Root gets an email from the echo command which reads:
:0.0

HTH,

Bill



Running a VNC server is a bit different from running an X server. I have not looked at the security settings for the VNC server. The VNC server takes the place of the normal X server, so the settings of the VNC server determine what programs can connect.

My experence in using ssh with X has been slightly different - I use ssh to run a program on a remote machine, and have it connect to the X server on my machine. With ssh set to forward the X connection, the local X server thinks I am running a program on the local machine. If I am running X localy, it works better then VNC for me. I usualy do not need the remote window manager. If I do, then I start it in and Xnest window on my normal desktop.

Mikkel

--

   Do not meddle in the affairs of dragons,
for you are crunchy and taste good with ketchup.


____________________________________________________
Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com
Join the Club : http://www.mandrakeclub.com
____________________________________________________

Reply via email to