Accessing X server in cron job

From: <kevin_at_meso.com>
Date: Tue, 08 Dec 1998 14:50:42 -0500

Hi managers,

I am trying to run a script via cron that needs
to connect to the X server on the same machine that the
cron job runs on (The script, among other things, creates
GIF files using a software package whose GIF driver is actually
hacked from an x-window driver, hence the need for a connection
to an X-server). When run interactively, all is fine as long
as the DISPLAY variable is properly set. However, from cron,
even if I set the DISPLAY correctly (e.g. "foo:0.0") in the script,
when the cron job is run, the connection to the X-server fails
with the following message:

Xlib: connection to "foo:0.0" refused by server
Xlib: Client is not authorized to connect to Server

The only way it will work is if someone is directly logged into the
console, and I issue the command "xhost foo".

Is there any way I can run the cron job without having to be logged
into to the console and running xhost?

Thanks,

Kevin Tyle <kevin_at_meso.com>
MESO, Inc.
Received on Tue Dec 08 1998 - 19:53:17 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:38 NZDT