Operating System - HP-UX
1835930 Members
2443 Online
110088 Solutions
New Discussion

Re: root: crontab runs ok, at/batch hang

 
SOLVED
Go to solution
AMSA Unix Admin
Advisor

root: crontab runs ok, at/batch hang

On hp-ux 11.0, w/ Jun 2002 patches. root crontabs work 100% ok. However, at and batch both hang. I've tried this on several systems, all same OS version and patch level, and same behavior. Regular users have no problem w/ cron/at/batch - just root hangs. The at/batch jobs get submitted but they hang. If I fill the a and b queue (by scheduling more that 4 at jons) I can look at the job script. For root jobs, there is an additional line in the middle of the job file which reads '/usr/bin/sh' which of course is the posix shell. This appears to be what it is hanging on. If I run the job manually at the command prompt it spawns into another shell, when I type ctrl-d, the shell exits and the atjob completes.
The root login shell is /sbin/sh. I tried changing to /usr/bin/sh but same problem. The cron.log shows that the at job starts. last time I successfully ran this was prior to june 2002 patch bundle.

Here's some sample output:

at now
date

warning: commands will be executed using /usr/bin/sh
job 1032824564.a at Mon Sep 23 19:42:44 2002

pstree -s cron
-+- 00001 root init
\-+- 04265 root /usr/sbin/cron
|-+- 04297 root sh
| \--- 04298 root /usr/bin/sh
|-+- 04318 root sh
| \--- 04319 root /usr/bin/sh
|-+- 04304 root sh
| \--- 04305 root /usr/bin/sh
\-+- 04313 root sh
\--- 04314 root /usr/bin/sh

! *** cron started *** pid = 4265 Mon Sep 23 13:47:59 EDT 2002
> CMD: 1032803323.a
> root 4297 a Mon Sep 23 13:48:46 EDT 2002
> CMD: 1032803336.a
> root 4304 a Mon Sep 23 13:49:04 EDT 2002
> CMD: 1032803385.a
> root 4313 a Mon Sep 23 13:49:47 EDT 2002
> CMD: 1032824564.a
> root 4318 a Mon Sep 23 13:49:52 EDT 2002

Thank you in advance for any help.

Chuck Davis
4 REPLIES 4
Tracy_5
Advisor
Solution

Re: root: crontab runs ok, at/batch hang

Please execute the following commands:

what /usr/bin/at

swlist -l fileset -a state |grep cron

If you have PHCO_24702, this may explain what's happening:

On machines having latest kernel patches (available in Sept-2001 Quality pack)
and the previous at/cron patch( [PHCO_24702/PACHRDME/English]
), atjobs are not getting
executed when any of LANG, LC_ALL, LC_CTYPE are set.
Steps to reproduce the
defect:
1. Start the cron daemon $ /sbin/init.d/cron start
2. Set the LANG to
some locale. $ export LANG=ja_JP.SJIS
3. Initiate an atjob. $ at now <>t.1 EOF
4. Check whether the atjob was executed. $ ll t.1 t.1 not found
Resolution: With the above environment, cron was not able to release the lock on
the atjob file which resulted in a race condition. cron(1M) has been fixed to
remove this race condition.

To resolve this, install the latest cron patch, PHCO_27141

Regards,
Tracy
AMSA Unix Admin
Advisor

Re: root: crontab runs ok, at/batch hang

Tracey,

Thanks! I did not have the 24702 patch loaded. However I did have LANG set. I unset it and at/batch works. I will try the 24741 patch soon.

Thanks also for posting to my other empty message too - I hit enter before I typed anything.

Regards,

Chuck
Tracy_5
Advisor

Re: root: crontab runs ok, at/batch hang

You're welcome, Chuck. I'm glad I could help. Thank you for the points :-)

Tracy
Jim Walls
Trusted Contributor

Re: root: crontab runs ok, at/batch hang

Tracy, you are a beauty!
I've been trying to resolve this problem for several weeks. In my case, the symptoms showed up in Omniback. We use the detach.sh script - which invokes an at job - to off-line the database shutdown commands.

After installing the March 2002 or subsequent bundles for HP-UX 11.00, our Omniback pre-exec and post-exec scripts hung.

The HP response centre in Melbourne, Australia, advised us to use the /opt/omni/lbin/utilns/detach program in place of the detach.sh script. This works fine for us in this instance but it is great to be able to resolve the root cause of our original problem.

Regards
Jim