I notied that when checking the status of my mac os x launched JWS
applications that it always said not running and removed the 'stale' PID
file. This wasn't the case and I noticed an error in the script that was
causing the problem.
in the testwrapper shell script you need to add a conditional to the block
as shown below that removes the -o args since on mac os x, this option
doesn't exist.
if [ "$DIST_OS" = "macosx" ]
then
# macosx doesn't support -o args
pidtest=`$PSEXE -p $pid | grep $WRAPPER_CMD | tail -1`
else
#it is possible that 'a' process with the pid exists but that it is not the
# correct process. This can happen in a number of cases, but the most
# common is during system startup after an unclean shutdown.
# The ps statement below looks for the specific wrapper command
running as
# the pid. If it is not found then the pid file is considered to be stale.
pidtest=`$PSEXE -p $pid -o args | grep $WRAPPER_CMD | tail -1`
fi
Logged In: YES
user_id=1088921
Mac OS doesn't support "args", but does support "command",
which does the same thing as "args" or "cmd" etc on other
*nix systems.
Cheers,
Nick.
Logged In: NO
The real problem with this script is the quotation marks. The single quotation marks in (pidtest=`$PSEXE -p $pid | grep $WRAPPER_CMD | tail -1`) prevent the variables from being read and executed. I changed the line to (pidtest="$PSEXE -p $pid | grep $WRAPPER_CMD | tail -1") and everything works.
Logged In: NO
Never mind... :-)
Logged In: NO
Don't do what I just said to do two comments below. The actual problem is in how grep recognizes unicode characters in paths. The (`) character is actually correct. Using (") doesn't actually work and will cause many other problems...