[SunHELP] Script migration problems

Ben Ricker sunhelp at sunhelp.org
Thu Mar 29 10:14:19 CST 2001


On 29 Mar 2001 10:42:13 -0500, Dale Ghent wrote:
> On 29 Mar 2001, Ben Ricker wrote:
> 
> | I did as you suggested but still get the same problem. I have noticed
> | that every time, the PID written to the file is the JVM's real PID
> | subtract 3...a BIG kludge would be to take the PID and subtract 3 from
> | it. But that is not really a good idea.
> 
> Well, realistically, resolving "$$" by the shell itself will give you the
> shell's own PID.. not of any program it just kicked off.

I thought the PID of a file it kicks off with exec was the same as the
shell.

> On the command
> line, do "echo $$" and then do a "whodo". You'll see that the PID returned
> by echo matches the PID of your login shell. Why this is different on
> Linux, I have no idea.
> 

It works on Linux because the PID of the exec'ed process is the same as
the shell. Weirder anad weirder.....

> | Anyway to kill a process based upon name? I know Linux has 'killall
> | <processname>' and this would be perfect (albeit inelegant). 
> 
> Yes, in Solaris 7 or later, you can use the pkill command in the same
> fassion.

I used the pkill instead of pulling the PID and using kill -9 $PID but
this won't do for the long term. I have to run a separate java process
that cannot be killed when the other one may be killed periodically.
Plus, I have a monitoring script which relies on the PID to check to see
if it is still running and if not, respawn it...

Sigh,,,,,

Thanks of for the info,

Ben Ricker




More information about the SunHELP mailing list