Re: [SLUG] x window tk script to run from cron

From: Paul M Foster (paulf@quillandmouse.com)
Date: Sun Feb 27 2005 - 14:01:44 EST


On Sun, Feb 27, 2005 at 12:50:47PM -0500, Larry Brown wrote:

> Hello gang, anyone ever come across this?
>
> I have written a small script that will check a condition. If the
> condition check fails, it is supposed to produce a window in KDE that
> produces a message based on the condition response. This way I am
> alerted to the situation. I can run the script fine from the shell.
> However, I do not get a window when running it from cron. I have tried
> to use suid to run the script as me, but when running the script as
> another user it fails to connect to 0:0 due to security. Temporarily I
> can bypass that security by allowing another user to connect to my
> x-server, but I don't think I can do this from cron.
>
> Any ideas?

Cron doesn't run in an X environment. So if it's trying to launch an
X-based application (which is what it sounds like), it's going to fail
on that part. Most X apps launched from an xterm can detect that they're
running in an X environment and launch properly. But cron doesn't run
that way. I'm guessing that if you try to run any X app from a pure
console (not an xterm, but a real console), you'll get the same or
similar error message.

Paul
-----------------------------------------------------------------------
This list is provided as an unmoderated internet service by Networked
Knowledge Systems (NKS). Views and opinions expressed in messages
posted are those of the author and do not necessarily reflect the
official policy or position of NKS or any of its employees.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 19:40:38 EDT