Re: [SLE] crontab script has X server problem

From: Danny Sauer (suse-linux-e.suselists_at_danny.teleologic.net)
Date: 09/23/04

  • Next message: Patrick Shanahan: "Re: [SLE] mail to external addresses"
    Date: Thu, 23 Sep 2004 15:22:48 -0500
    To: SuSE List <suse-linux-e@suse.com>
    
    

    SuseUser9X wrote regarding 'Re: [SLE] crontab script has X server problem' on Thu, Sep 23 at 15:12:
    > Unfortunately no. I have the export $DISPLAY:1.0 in the script.
    > This works when I'm logged in as ROOT but does not display when
    > the crontab is executed and anyone else in logged in.

    This is as expected. X restricts the display of applications to users
    and hosts who are explicitly allowed to use the display. So, if someone
    other than root is logged in, then root can't use the display unless
    the display owner grants root access.

    You'd probably have better luck running a program that monitored a file,
    and having that file edited from a cron job. Or, maybe leave an xconsole
    up and write to /dev/console. Etc.

    --Danny

    > SuseUser9X wrote regarding '[SLE] crontab script has X server problem' on
    > Thu, Sep 23 at 07:18:
    > > I have a script running thru crontab that calls a QT popup
    > > (named shutdown_warning). The popup does not display on the
    > > screen and the error received is:
    > >
    > > shutdown_warning: cannot connect to X server
    > >
    > > The script calls "shutdown_warning" from roots home directory.
    > > The crontab is being executed from root.
    > >
    > > It displays fine on the user console if, as root, I execute the
    > > script and export $DISPLAY:1.0
    > >
    > > I need this popup to display on the user console and all
    > > remote console connections.
    > >
    > > Any help would be appreciated.
    >
    > Is it enough to just put
    > DISPLAY=1:0
    > at the beginning of the crontab file that describes the job? If that
    > environment variable is all that's missing, that's all you have to do.
    >
    > --Danny

    -- 
    Check the headers for your unsubscription address
    For additional commands send e-mail to suse-linux-e-help@suse.com
    Also check the archives at http://lists.suse.com
    Please read the FAQs: suse-linux-e-faq@suse.com
    

  • Next message: Patrick Shanahan: "Re: [SLE] mail to external addresses"

    Relevant Pages

    • Re: Output to file lost when using cron
      ... > When executing as 'root' user it sends the output to the file ... If I have the script run from cron no output is generated. ... Did you change the crontab ...
      (comp.unix.aix)
    • Re: system crontab
      ... I would like to daily run a certain script that cleans exim's queue from frozen messages: ... I have created a file called rm_frozen_msg.sh, gave it appropriate permissions and then installed it in my user crontab. ... Because it did not work I read the man and found out that I cannot run scripts as another (root) user. ... I deleted sudo from the file. ...
      (freebsd-questions)
    • Re: Why crontab is not able to run some commands ?
      ... added that script to crontab in order to run as automatic. ... Despite root user, the crontab could not run above file. ... The only change to your cron line you would have to make is to drop the username 'root'. ...
      (freebsd-questions)
    • Re: Why crontab is not able to run some commands ?
      ... added that script to crontab in order to run as automatic. ... root /etc/scriptfile ... The University of Texas at Dallas ...
      (freebsd-questions)
    • crontabn issue mounting
      ... This script works when I run it as root. ... When I run it in a crontab I ... hde2: found reiserfs format "3.6" with standard journal ...
      (alt.os.linux.suse)