Results 1 to 7 of 7

Thread: at command not working, daemon is running

  1. #1
    Join Date
    Jun 2011
    Beans
    3

    at command not working, daemon is running

    Hello
    I run Ubuntu 10.04 LTS.
    I have a problem with "at" command not working.
    I have used it for ages with no problem. Suddenly it appears not to work anymore.
    Atd daemon is running.

    Examples:
    $ echo "ciao" | at now
    warning: commands will be executed using /bin/sh
    job 346 at Wed Jun 8 09:39:00 2011

    It does nothing. Same if I use sudo.

    $ at 9:41
    warning: commands will be executed using /bin/sh
    at> echo "ciao"
    at> <EOT>
    job 347 at Wed Jun 8 09:41:00 2011

    Does nothing again.

    Daemon:

    $ ps -elf | grep atd
    5 S daemon 2188 1 0 80 0 - 4722 hrtime 09:18 ? 00:00:00 atd
    0 S antonio 2728 1914 0 80 0 - 1907 pipe_w 09:41 pts/0 00:00:00 grep atd

    Thanks for any help
    antonio

  2. #2
    hakermania's Avatar
    hakermania is offline Τώρα ξέρεις τι γράφω εδώ!
    Join Date
    Aug 2009
    Location
    Greece
    Beans
    1,705
    Distro
    Ubuntu Development Release

    Re: at command not working, daemon is running

    Hello, i executed myself
    Code:
    echo "Hello" | at now
    and did nothing, I've never used 'at' before because I use 'sleep', but it seems that 'at' makes the process backround and redirects the output somewhere else, not in the current terminal, while the commands really run. For example, if you give
    Code:
    echo "Hello" > ~/Desktop/HelloFile | at now
    it WILL create a file named HelloFile with the content 'Hello' in your Desktop.
    And
    Code:
    gedit | at now
    will execute gedit now

  3. #3
    Join Date
    Jun 2011
    Beans
    3

    Re: at command not working, daemon is running

    Thanks hakermania

    This works:

    gedit | at now
    But this:

    $ gedit | at 9:55

    launchs gedit, but not at 9:55 but immediately

    And this does nothing again:

    $at 9:56
    warning: commands will be executed using /bin/sh
    at> gedit
    at> <EOT>
    job 351 at Wed Jun 8 09:56:00 2011

  4. #4
    hakermania's Avatar
    hakermania is offline Τώρα ξέρεις τι γράφω εδώ!
    Join Date
    Aug 2009
    Location
    Greece
    Beans
    1,705
    Distro
    Ubuntu Development Release

    Re: at command not working, daemon is running

    same problem here :/

  5. #5
    Join Date
    Feb 2010
    Location
    Silicon Valley
    Beans
    1,898
    Distro
    Xubuntu 12.04 Precise Pangolin

    Re: at command not working, daemon is running

    I see there is some confusion about how to use the at(1) command. Several of the things you tried were correct, however you came to the incorrect conclusion that at was not working.

    The important thing to remember about at or cron jobs is that they run in a sanitized environment. They cannot access the screen without jumping through some extra hoops, and they cannot write text to your terminal window. The output from at/cron jobs will be emailed to you (unless you redirect the output).

    If you have an MTA installed (such as postfix or exim4), then you will receive the email. If you do not have an MTA installed, then the output goes to the bit bucket. Check your log files (/var/log/syslog). You will probably see a message that says something like (this is from memory): CRON: no MTA installed, discarding output.

    Here's the exact message you'll see in the log if the at daemon cannot find an MTA:
    Code:
    atd[pid]: Exec failed for mail command: No such file or directory
    So the first thing you should do is install an MTA so that you can receive locally generated email.


    Now, on to your examples:
    Code:
    $ echo "ciao" | at now
    warning: commands will be executed using /bin/sh
    job 346 at Wed Jun  8 09:39:00 2011
    This will work. However, the at daemon attempts to execute a program named "ciao". Then it sends you an email that says it can't find "ciao". Remember that the "echo" here runs in your current shell (not the at daemon shell).

    Code:
    $ at 9:41
    warning: commands will be executed using /bin/sh
    at> echo "ciao"
    at> <EOT>
    job 347 at Wed Jun  8 09:41:00 2011
    This will work. The at daemon executed the echo command and the "caio" is sent to the standard output, which is then emailed to you.


    And now here's the hoop you need to get gedit to work. Since the environment has been sanitized, it does not have the $DISPLAY variable that it needs. The following will work:
    Code:
    $ at now
    warning: commands will be executed using /bin/sh
    at> env DISPLAY=:0 gedit
    at> <EOT>

  6. #6
    hakermania's Avatar
    hakermania is offline Τώρα ξέρεις τι γράφω εδώ!
    Join Date
    Aug 2009
    Location
    Greece
    Beans
    1,705
    Distro
    Ubuntu Development Release

    Re: at command not working, daemon is running

    Thanks gmargo, really useful info
    Personally I didn't know a lot about at but now I do know a few things

  7. #7
    Join Date
    Jun 2011
    Beans
    3

    Re: at command not working, daemon is running

    Thanks a lot.
    Everything is clear now and yes, the problem is solved.
    Thanks again

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •