SURUN jobs hang after upgrade to Version 8.0

Document ID : KB000089378
Last Modified Date : 14/04/2018
Show Technical Document Details
Issue:
SURUN jobs hang after upgrade to Version 8.0
Resolution:
Detailed Description and Symptoms
There has been some changes in behavior in SURUN since V6. Here are some examples:
 
.profile changes:
SURUN hanging for user due to no ‚SHELL' specified in .profile.
Solution: added ‚SHELL=/bin/ksh' last line of ‚.profile'.
       
SURUN hanging on user due to ‚.profile' setting switching from ‚ksh' to ‚borne' shell and executing a ‚ksh' script.
Solution:  Comment out the switch to ‚bash'
  
We ran into another job with a script that was performing a mailx command and was also hung in RUNNING status and not completing.  The command had the BEFORE
line shown below and I requested they append </dev/null to the line and it ran and completed in DEV ok - we are waiting for them to update in Production.
Before:    mailx -s "$MAIL_SUBJECT" $EMAIL_LIST $PR_PAGER_EMAIL_LIST
After:    mailx -s "$MAIL_SUBJECT" $EMAIL_LIST $PR_PAGER_EMAIL_LIST </dev/null
 
 
The issue becomes that some scripts written by customer require interactivity that used to be ok in V6 but no longer work in V8. In the mailx example the script hung because there was no subject line and the script was waiting for this. In V6 it would just move on but in V8 it will hang and wait.
 
Here are more examples of some hanging issues we found using SURUN on V8 with our onsite contractors:
 
Changing SQLPlus Syntax
Many scripts are using the syntax to run a sqlplus script:
sqlplus -s $login @${PROGRAM}/snkpochange.sql
 
This is a problematic as sqlplus will not end if a error occurs. The recommended approach is to pipe your script through sqlplus with a start command:
echo "start ${PROGRAM}/snkpochange.sql" |sqlplus -s $login
                This will ensure the script does not hang for any reason. We have tested this approach on a couple scripts here and found that it resolved the hanging issues.
 
Using cat instead of more
I found an instance where a script was using more to concatenate a file to another. More provides interactive pauses so a page of text can be read at a time. These pauses can cause the script to hang. Using cat will resolve this problem.
 
 
Removing Interactive scripts from users .profile
SURUN sources the user's $HOME/profile before it launches the job. If there is anything in the .profile that requires interactive input, this will cause a hang.