I have an sh shell running on linux. It has a loop and each loop instantiates another sh that instantiates a java class. This works great on a Solaris box (we are transitioning) but hangs on each iteration of the loop on a linux box. Here is the loop...
for JRNL in `$DBRUNSCRIPT $FLAG -jm -work -q -j bmj /highwire-dev/journals/mstr/maint/db/find_portal_jobs.sql` #this command returns proper values
techo "portaluserjobs: Starting $JRNL"
/mstr/userjobs/scripts/userjobs -n portalRole -j $JRNL
Again, this works fine on Solaris. We have made no changes to the shells. Each iteration hangs...then if I go to where the script is running and Ctrl-C it will go on to the next iteration. Not sure if this is a linux issue or not. Covering all bases as investigation thus far has not produced a solution.
Yes, there are small, but annoying differences between Java on Linux and Java on Solaris. There are not-so-small differences between the Linux bash shell and the Solaris shell. Circa 2005, the Solaris 8 shell more closely resembled the 1995 Linux bash than it did the 2005 Linux bash. I never really paid attention to what - if any - improvements had been made for Solaris 10 or 11. I did find it very annoying that the distributed Tomcat for Solaris 10 was Tomcat 4, even though Tomcat 4 had passed End of Life and was no longer supported by Apache,
Check and see if hitting "Enter" will advance your script. It's possible that there's a hangup looking for data from stdin (Ctrl-D is a good bet as well). Otherwise there appears to be an issue in your Java app that prevents it from terminating.
An IDE is no substitute for an Intelligent Developer.
Joined: Jul 25, 2012
Hi, So, you were all on the right track I just didn't see the responses before we solved the issue. (I should change my frequency if I'm going to be posting). So ends up the shells were fine. We are also going from Java 1.42 to 6, and from Weblogic/Apache/Jserv to Tomcat/Apache. So ends up threading is handled a bit differently since we are no longer using the same type of JVM. So adding an additional poll for life was necessary. Now everything works as expected. As to whether the code is still doing the proper tasks is the next to be scrutinized.