[SunHELP] Script migration problems
sunhelp at sunhelp.org
sunhelp at sunhelp.org
Thu Mar 29 09:25:34 CST 2001
--openmail-part-3a33e20c-00000001
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
;Creation-Date="Thu, 29 Mar 2001 09:25:34 -0600"
Content-Transfer-Encoding: 7bit
Depending on your version of solaris you have a killall as well. The
solaris killall actually kills /all/ your processes. In solaris 8 check
out the man pages for pkill and pgrep, it will do what you want.
-----Original Message-----
From: bricker [mailto:bricker at us-rx.com]
Sent: Thursday, March 29, 2001 9:14 AM
To: sunhelp
Cc: bricker
Subject: Re: [SunHELP] Script migration problems
On 28 Mar 2001 22:49:10 -0500, Dale Ghent wrote:
> On 28 Mar 2001, Ben Ricker wrote:
>
> | I have a script which I am migrating from Redhat Linux to Solaris
8. The
> | script launches a java application. Here is the key lines from the
> | script:
> |
> | # Write the PID for this process to the pidfile.
> | echo $$ > $PIDFILE
> |
> | echo "Starting JVM..."
> | exec java org.apache.jserv.JServ $PROPERTIES $1 2>> $LOG_FILE &
> |
> | How this worked on Linux is that the "echo $$ > $PIDFILE" wrote the
> | shells PID and then the exec statement started the JVM using that
same
> | PID. However, on Solaris, this does not work; I cannot get theright
PID
> | into that file. It does wrtie a PID, just the wrong one. Therefore,
it
> | screws with my ability to restart or stop the JVM using the script.
> |
> | Any pointers?
>
> A easy solution I guess would be to install bash in /usr/local/bin and
> then change the she-bang line in your script to referenc it (but
under no
> circumstances should you REPLACE /bin/sh on Solaris with bash).
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.
Anyway to kill a process based upon name? I know Linux has 'killall
<processname>' and this would be perfect (albeit inelegant).
Thanks for the input,
Ben Ricker
_______________________________________________
SunHELP maillist - SunHELP at sunhelp.org
http://www.sunhelp.org/mailman/listinfo/sunhelp
--openmail-part-3a33e20c-00000001--
More information about the SunHELP
mailing list