For some reason, one of my hosts is particularly fond of asking for a 
reauth to run atq. OK, I don't have a particular problem with that in 
general, but when scripting around it ...

Oh, and where the password response is listed as (none), that's a ^D.

So we have ...

  --(  %:~  )-- atq -n
Reauthentication by testuser is required to use authorization:
         solaris.jobs.admin
Password: (none)
Authentication failed
0

OK, so one would normally just trap a non-zero return code, right?

  --(  %:~  )-- atq -n ; echo return: $?
Reauthentication by testuser is required to use authorization:
         solaris.jobs.admin
Password: (none)
Authentication failed
0
return: 0

Alright, but that's a pretty boring whinge. Let's authenticate!

  --(  %:~  )-- atq
Reauthentication by testuser is required to use authorization:
         solaris.jobs.admin
Password: (correct passwd)
Warning: 3 failed authentication attempts since last successful 
authentication.  The latest at Thu Jun 04 02:34 2020.
no files in queue.

  --(  %:~  )-- atq -n
0

  --(  %:~  )-- atq -n </dev/null
Cannot authenticate testuser
0

Woah!? We get an authentication error when we can't read from stdin?

Let's schedule a job and run it again:

--(  %:~  )-- atq -n
1

  --(  %:~  )-- atq -n </dev/null
Cannot authenticate testuser
1

So we get the correct returned number of jobs, but still with an 
authentication grizzle. Hang on ...

  --(  %:~  )-- atq
Reauthentication by testuser is required to use authorization:
         solaris.jobs.admin
Password: (none)
Authentication failed
  Rank     Execution Date     Owner      Job            Queue   Job Name
   1st   Jun  4, 2020 02:45   testuser   1591202700.a     a     stdin

  --(  %:~  )-- atq -n
Reauthentication by username is required to use authorization:
         solaris.jobs.admin
Password: (none)
Authentication failed
1

And so ...

  --(  %:~  )-- atq -n
Reauthentication by testuser is required to use authorization:
         solaris.jobs.admin
Password: (none)
Authentication failed
1

  --(  %:~  )-- atq -n </dev/null 2>/dev/null
1

OK, let's try something more interesting ...

  --(  %:~  )-- atq
Reauthentication by testuser is required to use authorization:
         solaris.jobs.admin
Password: (none)
Authentication failed
  Rank     Execution Date     Owner      Job            Queue   Job Name
   1st   Jun  4, 2020 02:50   testuser   1591203000.a     a     stdin

  --(  %:~  )-- atrm 1591203000.a
1591203000.a: Reauthentication by testuser is required to use 
authorization:
         solaris.jobs.admin
Password: (none)
Authentication failed
removed

--(  %:~  )-- atq
Reauthentication by testuser is required to use authorization:
         solaris.jobs.admin
Password: (none)
Authentication failed
no files in queue.

So even when we fail to re-authenticate, we can still remove a job. We 
don't even get asked about authentication when we schedule a job:

  --(  %:~  )-- at 0500
at> uptime
at> <EOT>
commands will be executed using /bin/zsh
job 1591210800.a at Thu Jun  4 05:00:00 2020

  --(  %:~  )-- atrm 1591210800.a
1591210800.a: Reauthentication by testuser is required to use 
authorization:
         solaris.jobs.admin
Password: (none)
Authentication failed
removed

  --(  %:~  )-- atq
Reauthentication by testuser is required to use authorization:
         solaris.jobs.admin
Password:
Authentication failed
no files in queue.



-- 
Andre van Eyssen.                  Phone:     +61 417 211 788
mail:     [email protected]      http://andre.purplecow.org
About & Contact:          http://www.purplecow.org/andre.html

_______________________________________________
msosug mailing list
[email protected]
http://mexico.purplecow.org/m/listinfo/msosug
Delivered for: [email protected]

Reply via email to