Unexported $DISPLAY prevents `at' from executing GUI apps

Bug #94933 reported by machoopy on 2007-03-22
30
This bug affects 3 people
Affects Status Importance Assigned to Milestone
at (Ubuntu)
Wishlist
Unassigned

Bug Description

Binary package hint: kubuntu-default-settings

***
An example of problem:
Mr X. likes his music to be played the next day during the morning. So, as an experience unix user, he simply types into the console:

$ at 6:00am tomorrow <enter>
>amarok -p
><ctrl-d>

Unfortunately, Mr X's music is never played, as the command is never executed, and Mr. X isn't awaken for work the next day.
***

I really don't know why the 'at' command fails to work, as it works perfectly on all distros that I've used in the past. You can test it in various ways, and it appears that the 'atq' will indicate that the command is in queue until the time of execution. Nothing happens. :-/

This appears that it is a true bug, and if so, it is something that should be fixed ASAP. May linux users use this command as an alternative to 'cron.'

Thank you.

Same problem in bug 113988

Here's a simple test. Can you try it please. at(1) is working for some of us so we need to find out why your experience differs.

$ echo touch /tmp/created_by_at | at now
warning: commands will be executed using /bin/sh
job 3787 at 2007-08-13 11:45
$ ls -l /tmp/created_by_at
-rw-r--r-- 1 ralph ralph 0 2007-08-13 11:45 /tmp/created_by_at
$

Ralph,
Wow, it's nice to know that people are still hacking away at
this problem. Below are my results from your test. Good
luck!
mhjohnson@matt-desktop:~$ echo touch /tmp/created_by_at | at
now
warning: commands will be executed using /bin/sh
job 27 at Mon Aug 13 21:06:00 2007
mhjohnson@matt-desktop:~$ ls -l /tmp/created_by_at
-rw-r--r-- 1 mhjohnson mhjohnson 0 2007-08-13
21:06 /tmp/created_by_at
mhjohnson@matt-desktop:~$

On Monday August 13 2007 6:50:29 am Ralph Corderoy wrote:
> Here's a simple test. Can you try it please. at(1) is
> working for some of us so we need to find out why your
> experience differs.
>
> $ echo touch /tmp/created_by_at | at now
> warning: commands will be executed using /bin/sh
> job 3787 at 2007-08-13 11:45
> $ ls -l /tmp/created_by_at
> -rw-r--r-- 1 ralph ralph 0 2007-08-13 11:45
> /tmp/created_by_at $

Hi, same problem here on feisty.

I ran your simple test Ralph:

nicolas@whitestar ~ % echo touch /tmp/created_by_at | at now
warning: commands will be executed using /bin/sh
job 8 at Tue Oct 16 23:32:00 2007
nicolas@whitestar ~% ls -al /tmp/created_by_at
-rw-rw-r-- 1 nicolas users 0 2007-10-16 23:32 /tmp/created_by_at

And some others:

echo mpg123 /home/nicolas/Musique/arthurH_feist.mp3 | at now
warning: commands will be executed using /bin/sh
job 11 at Tue Oct 16 23:41:00 2007
music plays...

echo vlc|at now
nothing...

echo zenity|at now
nothing...

Could there be something wrong with display?

Nicolas Bourdais (nbourdais) wrote :

If you export DISPLAY before your command it works:

try :

echo export DISPLAY=$DISPLAY \&\& zenity --warning|at now

Nicolas

Daniel Hahler (blueyed) wrote :

Ok, so the missing export of $DISPLAY appears to be the problem (amarok requires this, too).

Here's a quote from at.c however:
    /* Write out the environment. Anything that may look like a
     * special character to the shell is quoted, except for \n, which is
     * done with a pair of ""'s. Dont't export the no_export list (such
     * as TERM or DISPLAY) because we don't want these.
     */
where no_export is:
    "TERM", "DISPLAY", "_", "SHELLOPTS", "BASH_VERSINFO", "EUID", "GROUPS", "PPID", "UID"

Izkata (izkata) wrote :

Problem still exists in Ubuntu 8.04 - Any program that requires a GUI is unable to run without the "export DISPLAY=..." line.

FYI this is the same problem people are having with cron and crontab.

Daniel T Chen (crimsun) on 2008-09-29
Changed in at:
importance: Undecided → Medium
status: New → Confirmed
Psy[H[] (vovik-wfa) wrote :

still appears in Intrepid

Psy[H[] (vovik-wfa) wrote :

Problem is still in Jaunty Alpha 4

MarcRandolph (mrand) wrote :

Since at.c explains that DISPLAY is not exported on purpose, and there is a work-around in comment #5, marking this ticket as a feature request.

Changed in at (Ubuntu):
importance: Medium → Wishlist
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers