For me, it is impossible to use cron to run a GUI program when not logged in



(I have posted two days ago. The post may be unclear. Re-post with some re-phrasing)

Suppose my script run_gui.sh can be run successfully:

env -i /path/run_gui.sh

Within run_gui.sh, there are:
export XAUTHORITY=xxx
export DISPLAY=:0.0

(My Java gui program automatically runs for about one minute and exit automatically, no human interaction needed). If I put run_gui.sh on cron and logged out(These linux machines are shared desktops, not my personal machines).. Our IT support told me that my gui program have no place to put the display.(Since I have logged out, everything has closed). I told them that many people on newsgroup say that it is possible and they don't think so.

Another problem is that, since I was not logged in when the cron job("run_gui.sh") was running, so there is no XAUTHORITY value.

I am just confused: many people say it is possible to run a GUI program by cron. I assume that means they are not logged in when the cron job is run. How come it is impossible for me?

Thank you very much.
.



Relevant Pages

  • Re: Query regarding cron jobs
    ... The script is getting executed a few times when scheduled through cron ... The probability of successful execution is 6/10. ... showing any entries crontab -l as the entry in /etc/cron.d is for root ...
    (RedHat)
  • Re: Query regarding cron jobs
    ... The script is getting executed a few times when scheduled through cron ... The probability of successful execution is 6/10. ... showing any entries crontab -l as the entry in /etc/cron.d is for root ...
    (RedHat)
  • SUMMARY: cron entry: nth day of every month?
    ... cron can not handle this with its own syntax. ... 21st but "command" only runs if the output of the "date" command ... What I would suggest is rather than embedding the logic in each script ... The answer is it is _not_ possible to control it only with crontab ...
    (Tru64-UNIX-Managers)
  • [Solved] Long cronjobs terminate after 2 minutes/Ubuntu 8.10
    ... When I run the script in the foreground, it takes about 2 hours to ... Have you got your system set up so that cron sends mail to ... I configured Postfix for local mail only and updated ... I'm assuming that configuring the MTA is what did it. ...
    (Ubuntu)
  • Re: Expect: problem with fork under cron
    ... the code of a sample script that shows the problem: ... Forked process 524310 ... Child 1 exiting ... However, when run from cron, I see the following (script output was ...
    (comp.lang.tcl)