Forum     

Go Back   Digit Technology Discussion Forum > Software > Open Source
Register FAQ Calendar Mark Forums Read

Open Source A place where you can talk to like-minded people about the fastest growing software movement today! Discuss anything and everything about Open Source software and Operating Systems.

Closed Thread
 
LinkBack Thread Tools Display Modes
Old 04-10-2005, 01:08 AM   #1 (permalink)
Wise Old Owl
 
desertwind's Avatar
 
Join Date: Nov 2004
Location: Hyderabad
Posts: 1,096
Default Cron Jobs

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 root@localhost.localdomain  Tue Oct  4 01:05:02 2005
Date: Tue, 4 Oct 2005 01:05:02 +0530
From: root@localhost.localdomain (Cron Daemon)
To: root@localhost.localdomain
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 root@localhost.localdomain  Tue Oct  4 01:06:03 2005
Date: Tue, 4 Oct 2005 01:06:03 +0530
From: root@localhost.localdomain (Cron Daemon)
To: root@localhost.localdomain
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 ?
__________________
Sometime you'll think you understand everything

...Then you'll regain consciousness
desertwind is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 04-10-2005, 10:32 PM   #2 (permalink)
In The Zone
 
firewall's Avatar
 
Join Date: Mar 2004
Location: Kolkata - INDIA
Posts: 301
Default

Cron is not really designed to run GUI applications.

__________________
www.aloke.info
firewall is offline  
Old 05-10-2005, 12:55 AM   #3 (permalink)
sba
Broken In
 
Join Date: Jul 2005
Posts: 172
Default

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

Quote:
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.
sba is offline  
Old 05-10-2005, 02:05 AM   #4 (permalink)
Wise Old Owl
 
desertwind's Avatar
 
Join Date: Nov 2004
Location: Hyderabad
Posts: 1,096
Default

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 ?
__________________
Sometime you'll think you understand everything

...Then you'll regain consciousness
desertwind is offline  
Old 05-10-2005, 02:21 AM   #5 (permalink)
sba
Broken In
 
Join Date: Jul 2005
Posts: 172
Default

then it shdn't be a problem...
try to do all this as a normal user anyways and pls stop working as root.
sba is offline  
Old 05-10-2005, 11:32 AM   #6 (permalink)
FooBar Guy
 
GNUrag's Avatar
 
Join Date: Jun 2004
Location: GNUmbai
Posts: 1,245
Default

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.
__________________
- --
http://www.MovieAB.com - A tiny movie mashup!
GNUrag is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +5.5. The time now is 01:31 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2