LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Problems with the "at" command (https://www.linuxquestions.org/questions/linux-newbie-8/problems-with-the-at-command-918084/)

AchimRS 12-10-2011 04:32 PM

Problems with the "at" command
 
Hi all experts,
after reading dozens of tutorials and man-pages the at command still don't to what it sould, maybe one can help me here...

In case I submit a job like
Code:

echo "touch test1" | at now + 1 minute
the job is queued, so with "atq" I see the job like:
Quote:

23 Sat Dec 10 23:20:00 2011 a root
and when looking inside the queued job with "at -c 23" I see a script:
Quote:

#!/bin/sh
# atrun uid=0 gid=0
# mail root 0
umask 22
SSH_CLIENT=192.168.178.30\ 60168\ 22; export SSH_CLIENT
SSH_TTY=/dev/pts/0; export SSH_TTY
USER=root; export USER
MAIL=/var/mail/root; export MAIL
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/owfs/bin; export PATH
PWD=/root; export PWD
LANG=en_US.UTF-8\"\ ; export LANG
PS1=\\[\\e[0\;32m\\]\\u@\\h:\\W\>\ \\[\\e[0m\\]; export PS1
SHLVL=1; export SHLVL
HOME=/root; export HOME
LOGNAME=root; export LOGNAME
SSH_CONNECTION=192.168.178.30\ 60168\ 192.168.178.75\ 22; export SSH_CONNECTION
cd /root || {
echo 'Execution directory inaccessible' >&2
exit 1
}
touch test1
for now, everything looks fine. Also after the time has passed, the job was done, in my case the file ~/test1 was touched - fine! :)
But when looking in the queue again with "atq" I see:
Quote:

23 Sat Dec 10 23:20:00 2011 = root
23 Sat Dec 10 23:20:00 2011 a root
So it looks like the job is still in the "running" queue, even after hours - a simple touch?!?!
And in case I remove the job with "atrm 23" I get an warning:
Quote:

Warning: deleting running job
In addition - and this causes a real problem for me - sometimes the at-daemon "atq" is running hours and days after the last job using a high amount of CPU. I saw this with the "top" command and because of permanent load of 40..60% CPU my processor got hot :mad:

Any idea why my jobs never finish?
What do I need to do to really stop the jobs??

Thanks
Achim

Tinkster 12-10-2011 05:06 PM

Hi,

What OS/distro is this happening with, what version is your "at"?


Cheers,
Tink

AchimRS 12-10-2011 05:25 PM

Oh sorry, I forgot to mention that:
It's EmDebian Squeeze (a smaller/lighter build of Debian for embedded ARM).

"at" itself is version 3.1.12

thanks
Achim

Tinkster 12-10-2011 07:06 PM

Hi,

Now I'm uncertain whether to move this to our "embedded" forum or
to "debian" :} - which would you prefer?

It's certainly not in the realm of your ordinary newbie-thread; on
a desktop or "normal" server class machine I would have suggested to
use strace on the PID of your touch process, but in this case strace
probably won't be installed, or undesirable to install.



Cheers,
Tink

AchimRS 12-10-2011 08:37 PM

> Now I'm uncertain whether to move this to our "embedded" forum or to "debian" :} - which would you prefer?
Oh, even if my usage is in the embedded world, I'm sure it have nothing to do with embedded, I would prefer "debian" :-)

But with your hint I tested the behavior on my Ubuntu Jaunty workstation which have "at" in version 3.1.9 installed - and it works as expected, so after the touch was done the job is removed in the "atq"
Hmmm, this really looks like a bug either in Debian Squeeze (from which I don't have an ordinary workstation installation, only embedded) or from EmDebian.

thanks so far for the feedback

Tinkster 12-10-2011 08:58 PM

I happen to have a squeeze x86_64 installation, w/ at v.3.1.12, and your
example fires & disappears as expected. Makes me think it has to do w/ the
embedded part of your install after all.

Do you actually have strace installed on the embedded system?



Cheers,
Tink


All times are GMT -5. The time now is 04:09 AM.