LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 05-02-2023, 04:27 PM   #1
scottieH
Member
 
Registered: Mar 2021
Posts: 58

Rep: Reputation: Disabled
AT command shows active, but does not run


I'm on Red Hat 7.9. AT version is 3.1.13.
I schedule an AT job
Code:
$ at <HH:MM>
at> echo "UserA at job works" > /tmp/UserA.out
at> <EOT>
at -l shows the job scheduled
Code:
$ at -l
7 <Date/Time of execution> a UserA
When the execution time comes, the status changes to =
Code:
$ at -l
7 <Date/Time of execution> = UserA
This command should take a fraction of a second to execute. Just for fun, let's wait 5 minutes.
Code:
sleep 300
$ at -l
7 <Date/Time of execution> = UserA
$ ls -l /tmp/UserA.out
ls: cannot access /tmp/UserA.out: No such file or directory
/var/spool/at shows the generated file:
Code:
# ls -l /var/spool/at
-rwx------ UserA  UserGroup  5536 <creation date> =00007#####
drwx------ root  root         138 <Execution Date> spool

# ls -l /var/spool/at/spool
-rwx------ UserA  UserGroup    52 <Execution Date> a00007#####
I can execute the file /var/spool/at/=00007##### and it works correctly with a return code of 0.

The spool file /var/spool/at/spool/a00007##### just contains:
Code:
Subject: Output from your job     7
To: UserA
<blank line>
Has anyone seen this? Solution or Ideas?
TIA
 
Old 05-03-2023, 10:55 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,746

Rep: Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925Reputation: 5925
It works for me on a CentOS 7 VM and it should work the same. Try:

Code:
 echo "Hello" > /tmp/UserA.txt | at now +1 minutes
 
Old 05-09-2023, 12:36 PM   #3
scottieH
Member
 
Registered: Mar 2021
Posts: 58

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
It works for me on a CentOS 7 VM and it should work the same. Try:

Code:
 echo "Hello" > /tmp/UserA.txt | at now +1 minutes
It queues and switches to active, but does not run.
 
Old 05-09-2023, 02:10 PM   #4
Racho
Member
 
Registered: Oct 2021
Posts: 59

Rep: Reputation: Disabled
Try this:

Code:
echo "echo $(date) >> /tmp/UserA.txt" | at now +1 minutes
And at will execute the command echo $(date) >> /tmp/UserA.txt
 
Old 05-20-2023, 04:01 PM   #5
jayjwa
Member
 
Registered: Jul 2003
Location: NY
Distribution: Slackware, Termux
Posts: 786

Rep: Reputation: 250Reputation: 250Reputation: 250
IIR, there's a load avg restriction with "at". It won't run if your load is above that. Here, I had to change the default to something higher. There's an "ATD_OPTS" in /etc/default/atd (in my distro, might be different in yours).

Code:
# Default options for the atd daemon:
#
# -b 15: minimal interval in seconds between two jobs
# -l 3: do not start new jobs if the load average is above 3
ATD_OPTS="-b 15 -l 3"
Slackware might use some different directories than your OS, but this is what I see:
Code:
ls -l /var/spool/
total 64
drwxrwx--T 2 daemon daemon 4096 May 20 16:57 atjobs/
drwxrwx--T 2 daemon daemon 4096 May 20 16:57 atspool/
 
Old 05-31-2023, 04:53 PM   #6
scottieH
Member
 
Registered: Mar 2021
Posts: 58

Original Poster
Rep: Reputation: Disabled
pam.d is the culprit

I found it. The file /etc/pam.d/atd is incorrect and it prevents the at daemon from authentication.
I copied /etc/pam.d/crond to atd and it works!
This issue is fixed in atd v 3.1.23-2
 
  


Reply

Tags
cronjobs, redhat



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to build an active-active-active cluster with RHEL 8 and Percona MySQL LXer Syndicated Linux News 0 04-22-2021 11:54 AM
free -m shows 2GB used but gnome-system-monitor shows 1GB anjanesh Linux - General 1 03-04-2009 04:49 AM
ndiswrapper shows hardware, but iwconfig shows no device ZST Linux - Hardware 6 04-20-2006 12:15 PM
snmp staus shows it running but on trying MRTG, it shows public@ipaddr not giving res swati220781 Linux - Networking 3 07-08-2004 05:32 PM
desktop shows on TV but movie shows black screen litrelord Mandriva 6 07-05-2004 05:10 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration