Open gnome-terminal as a cron job

Mikkel L. Ellertson mikkel at infinity-ltd.com
Tue Oct 17 13:32:51 UTC 2006


Dylan Semler wrote:
> I'm tryng to run a cron job that will open a terminal.  The following
> is my user crontab (from crontab -e)
> 
> 
> SHELL=/bin/bash
> PATH=/sbin:/bin:/usr/sbin:/usr/bin
> MAILTO=Dylan
> HOME=/
> DISPLAY=:0
> 
> 15 0-23 * * * gnome-terminal
> 
> 
> A terminal never opens, and I get the following error in
> /var/spool/mail/root (shouldn't it be in .../mail/Dylan??)
> 
The way email addresses are handled, user names with uppercase
letters are a bad idea. By default, the name is converted to all
lowercase before it is delivered. So Dylan will never get mail, but
dylan will.
> 
> Xlib: connection to ":0.0" refused by server
> 
You are running into the security restrictions of the X server.
Normally, only the user that is currently logged into X can run
programs that connect to the X server. If you are running the cron
job as the user that is logged in, it may work if you leave HOME set
to the user's home directory instead of changing it to /. That way,
the proper authentication file is found that lets a program connect.

If you explain what you are trying to do, we can probably help you
find a better way to do it. I can not picture what you are trying to
do by opening a terminal from a cron job.

Mikkel
-- 

  Do not meddle in the affairs of dragons,
for thou art crunchy and taste good with Ketchup!




More information about the fedora-list mailing list