Status
Not open for further replies.

desertwind

Cyborg Agent
While trying to add cron jobs, it was ok with usual tasks. But when tried to add some programs with gui like rhythmbox and bittorrent i get some errors.

Error 1: rhythmbox
Code:
From [email]root@localhost.loca[/email]ldomain  Tue Oct  4 01:05:02 2005
Date: Tue, 4 Oct 2005 01:05:02 +0530
From: [email]root@localhost.loca[/email]ldomain (Cron Daemon)
To: [email]root@localhost.loca[/email]ldomain
Subject: Cron <root@localhost> rhythmbox
X-Cron-Env: <SHELL=/bin/bash>
X-Cron-Env: <PATH=/sbin:/bin:/usr/sbin:/usr/bin>
X-Cron-Env: <MAILTO=root>
X-Cron-Env: <HOME=/>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>

(rhythmbox:9435): Gtk-WARNING **: cannot open display:

Error 2: bittorrent
Code:
From [email]root@localhost.loca[/email]ldomain  Tue Oct  4 01:06:03 2005
Date: Tue, 4 Oct 2005 01:06:03 +0530
From: [email]root@localhost.loca[/email]ldomain (Cron Daemon)
To: [email]root@localhost.loca[/email]ldomain
Subject: Cron <root@localhost> bittorrent
X-Cron-Env: <SHELL=/bin/bash>
X-Cron-Env: <PATH=/sbin:/bin:/usr/sbin:/usr/bin>
X-Cron-Env: <MAILTO=root>
X-Cron-Env: <HOME=/>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>

Traceback (most recent call last):
  File "/usr/bin/bittorrent", line 32, in ?
    import gtk
  File "/usr/lib/python2.4/site-packages/PIL/__init__.py", line 37, in ?

RuntimeError: could not open display

Any clues ?
 

sba

Journeyman
firewall is correct. cron will most probably run GUI apps. btw i hv my doubts with this thing

X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>
looks like you created cron job as root and when the GUI app is launched it is not being able to connect to X server. try and create the cron job as the user who is currently logged into X. you can use crontab to do it. not very sure whether it will work but a long shot.
 
OP
desertwind

desertwind

Cyborg Agent
i've created the cron job as root
logged in as root
and trying to run the app as root.

Is that the real problem ?
 

sba

Journeyman
then it shdn't be a problem...
try to do all this as a normal user anyways and pls stop working as root.
 

GNUrag

FooBar Guy
Its actually possible to run GUI application from cron.

1) The user who is running X should allow X authentication from all users by giving:
$ xhost +
2) The cron script should know on which X display to draw the application by:
$ export DISPLAY=:0.0

Now this will work for GUI applications started from all users.
 
Status
Not open for further replies.
Top Bottom